Thursday, October 12, 2017

Saving a PDF of a Drawing Using iLogic

As you probably have noticed, Inventor iLogic rules are a frequent topic in this blog.  Sharing some ways I have used iLogic in the past is a subject I like sharing with others.  One of my first rules, that I was pretty proud of, was the ability to have iLogic save a PDF of Inventor drawings.  I tackled this because it is a task a large number of Inventor users need to perform.  I was able to figure out the code and I shared it in a YouTube video and in an Autodesk University class in 2012.  With the updated Event Triggers in Inventor 2018.1, I figured it might be time to updated the rule and share it with all of you.

The most popular question I got about the previous version was, "How do it get it to print all the sheets?"  By default, Inventor uses the last settings for one sheet or all sheets.  I had not figured out how to do that programmatically.  So I wanted to figure that out for this go round.

Like any other coder, I went to the web for help.  I pretty quickly found Curtis Waguespack's post.  So I used this code and my code to create what I call Franken-code (i.e. Frankenstein Code).

If you are interested in the code, you can download it from here.

The code is documented, but here is an explanation and demonstration of the code.


Happy Coding!!!

Using The New iLogic Event Triggers

I have been using iLogic since it was acquired by Autodesk and one of the biggest headaches with iLogic rules was setting event triggers for legacy files.  For example, I could write an iLogic rule that would save a PDF of a drawing.  It was simple to add the right event triggers to your template, but what about all the legacy files, those need the same event triggers.

I would typically show people how to added the triggers and told them to add the event triggers to the legacy files as they worked on them.  I didn't like that answer, but that is the way it had to be.  The Autodesk programming gurus, that run the Being Inventive blog, created the iLogic Code Injector, which would add rules to selected files.  You can find a write up on that here.  The biggest draw back there was that you were putting stand-alone rules in each of the files and not adding Event Triggers to External Rules.

In my last post, I mentioned an idea that was posted to the Inventor Idea Station, which I had offered feedback on, has been implemented.  The idea was for what I call Global Event Triggers.  In the case of the old Event Triggers, you were embedding in a file a trigger to run a rule on a certain event.  Now the Event Triggers have been reformulated in the Inventor 2018.1 Update.  Starting in the updated release, you can set Event Triggers for all files, or files of certain types.  For example, if you created a rule that created a PDF of the file, you most likely would not want that for your 3D model files.  So the new Event Trigger Dialog box allows you to set an event trigger for that rule when certain events occur on Drawing files.  


I really like the redesign of the iLogic Event Triggers, especially for rules that you want run on all files, or at least of all files of a specific type.  And setting them up could not be any easier.

1.  Open the Event Triggers dialog box
2.  Select the Tab for the file category
3.  Drag the iLogic rule from the left pane to the correct Event in the right pane

Here is a video I created that shows how to set up an Event Trigger using the new Event Trigger dialog.



I really like this new feature works.  I hope you do to.  Happy coding.

Friday, September 8, 2017

The Autodesk Idea Stations Works!

As someone that has been using Autodesk products for years,  I have seen release after release of new versions and seen new and enhanced features year after year.  When I first started using Autodesk products, if you felt a new feature should be added, or an existing feature should be changed, you had to go to a web site and submit a Feature Request.  A number of years ago, Autodesk introduced its user community to Idea Stations.

Ideas Stations are portions of the product forums where users can post ideas they have for a particular Autodesk software.  You could also look through other users' ideas and give a "kudos" to ideas you liked or agreed with.

Autodesk has been using those Idea Stations more and more often over the years.  About 4 or 5 years ago, they incorporated about 15 ideas from the Inventor Idea Station into that years release.  Last November I attended a focus group on new features for Inventor 2017.4 and Inventor 2018.  During that event, it was stated that between the Inventor 2017 and the Inventor 2017 R2 releases, Autodesk had incorporated about 50 ideas from the Inventor Idea Stations.  The presenter went on to state that they were on pace to include over 120 ideas between the Inventor 2017, R2, 2017.3, and 2017.4 releases.

I have two reasons to bring this up.  First, I try to plug the Idea Stations because that is the best way to have your voice heard by Autodesk.  If you have an idea, please share it.  Occasionally, browse the Idea Stations of all the products you use because you never know when someone will have an idea for a feature or function you haven't thought of and cannot live without, or suggest a workflow that will make your life easier.

My second reason for bringing it up, is I have proof it works.  Just this past weekend, I got an email from the Idea Station that an post I had commented on had a status change to "Implemented."  As it turns out, four years ago, I commented on an idea for Global Event Triggers in iLogic.  I have always held that iLogic Event Triggers being file specific created issues for users that legacy files that needed triggers for newer iLogic rules.  I gave the idea a "kudos" and added a comment about how I felt the Global Event Triggers should work.

If you would like to see the progression of this idea, you can find it on the Inventor Idea Station at this link.

I truly appreciated  the comment by Jon, from Autodesk, "This Idea was posted in the early days of this forum, and although it's far from having one of the highest vote counts, we see many being able to benefit from it in the future as they invest more in rules based design. We appreciate the patience!"

So even though this idea only got 29 votes, the Autodesk Development Team recognized the idea as being very valuable to lots of users and implemented, and included it in the Inventor 2018.1 product release.

Again, please post your ideas to the different Idea Stations, almost all Autodesk Products have their own Idea Station.  It is not hard to get to the the Idea Stations either, most products have a link to them right in the software.



Also, don't be afraid to "stuff the ballot box."  One of my co-workers, Jared, will often post an idea and ask the rest of us to give it a kudos.  I know of at least one of his ideas that have been implemented by Autodesk.  Posting your ideas, and giving kudos to the ones that you like is the best way to make the Autodesk Products we all use the best they can be.  


Thursday, July 6, 2017

A Difficult Sheet Metal Model

Recently, I was teaching an Inventor Sheet Metal Modeling class for a customer and they had an odd part that gave them fits when they tried to model it.  The idea of the part was they would bend two flanges  on either side of the part, put the part in a press break and bend one end up at an angle, then bend the other end down at an angle.

I can see why it gave them grief.  Inventor cannot calculate when the material stretches, or compresses, in more than one direction.  Nathan, one of my co-workers was assisting with the class, and between the two of us, we were able to create a workflow that would give them models that would represent the formed part and the flat pattern on a drawing.

The biggest issue on this part is the four regions where the side flanges get bent either up or down.  Nathan said that, if we left those regions off the Sheet Metal model, we should get a flat pattern.  I said that I have turned sheet metal models into iParts, just so I could suppress features that prevented models from flattening.

So we created the model without the four corners that would prevent the model from flattening.  That gave us a flat pattern.  I was then able to edit the flat pattern to fill in the gaps, so our flat pattern was a rectangle, and not an odd shape.  I attempted my technique of adding features and creating an iPart to suppress those features on one version to preserve the flat pattern.  In this case, the flat pattern still failed.

Then Nathan shared that he will sometimes derive a sheet metal model into another file for similar edits.  So we created a new standard part, then derived our bracket into that model.  We were then able to add Sweep or Loft features to represent the corners that were missing in the other model.  A benefit of deriving the sheet metal model into the standard part is that changes to the sheet metal model will then be pushed to the standard part version of the model.

Here is a video of the workflow from beginning to end.

 


This topic got me thinking of common Sheet Metal questions. I often get questions about how to bend/flatten bar and pipes.  There is actually a standard part modeling command called Bend Part.  It is kind of hidden in the interface, but it has been around for a pretty long time.  The idea, is that the user draws a bend line in a sketch.  For bar or pipe, you have to create the sketch on a plane tangent to the tube.  After that, it is just a matter of setting the right options for the Bend Part feature.  If you need a flat pattern of the bar or pipe, you can convert your model to an iPart and suppress the Bend Part feature on one member of the iPart family.

Here is a video I created that shows how to use Bend Part to bend a pipe.

Friday, June 9, 2017

InstaVR App Builder

This blog has been dedicated to CAD and other topics I find interesting.  One of my latest passions is Virtual Reality, or VR.  I don't own or have access to an Oculus Rift or HTC Vive, so I have really explored what is available through Google Cardboard.  I really like the fact that I have a VR capable device with me all, the time in my phone.  Because of this, I have become a little bit of a "Cardboard Junkie."  I have two of the plastic molded style and two of the paper-based style.

You probably have noticed that all my product references have been to some Autodesk product.  Since I work for an Autodesk re-seller, most of my time is spent in their products.  However, a few weeks ago I stumbled upon a company named InstaVR.  I think they offer a really cool service, and wanted to share that information with all of you.

Their goal is to make VR easy and accessible.  If you have 360 photography, stereo panoramas, and other similar content, you can build your own custom VR app for Andriod or iOS.  You may remember one of my previous blog posts about rendering stereo panoramas using Inventor, Revit, and InfraWorks.  I was able to load those images into InstaVR's easy-to-use web interface, and get an app that I could distribute to customers.  My initial attempt took about 30 minutes, with the help of the InstaVR tutorials.  The most difficult part was identifying the format of my stereo panorama, so InstaVR could translate it into the experience properly.  In my first app, I  linked three different environments together.  All the user had to do is set their view at a specific spot to jump to the next scene.

In my opinion, the biggest strike against stereo panoramas is that you cannot move around because the image is static.  It didn't take me long to realize that I could minimize that loss by creating a series of stereo panoramas of the same model and then stitch them into one experience with InstaVR.

Here is a link to the app I created with using this approach.





Please note, if you want to install this app, you will have to go to your phones security settings and allow apps from unknown sources.

InstaVR does offer the ability to insert hotspots that can be linked to videos or images.  You also can add music or voice-overs to be played in the experience.  

If you are interested in this service, InstaVR offers two types of accounts; Free and Pro.  If you have a free account you can make apps, but they will just have an InstaVR splash screen and water-marks on your images.  There is also a limitation to size and output types, when you have a free account.

Here is a screen shot from my app.



I really like this service, it is the closest I have come to building a true VR experience without using a gaming engine, like Autodesk Stingray.  If you are interested in VR, but are struggling to get started, this is a very easy away to begin making VR apps.


Friday, May 19, 2017

Updated Inventor Presentation Environment

I may be a little late with this news, but this is a topic that I felt deserved an entry into the blog.  In Inventor 2017, Autodesk redesigned the Presentation Environment, or in other words IPN files  I guess, this would be news for those of you that skipped 2017, and just installed 2018.

For any of you that have used Inventor Publisher, which was retired after the 2016 release,  the redesign probably feels similar to Inventor Publisher workflow.  Autodesk decided to move Inventor Publisher functions into Inventor.  Now, the new IPN files do not replicate everything that Inventor Publisher did, however, the Timeline and Snapshot views are very similar.

Personally, I like the new Timeline workflow.  It is already more inline with the Inventor Studio timeline than the old presentation files.  I feel that it is easier to see the order of operations and easier to edit than the old way.  One function that I use now, more than in the old method, is Capturing the Camera, or previously Precise View Rotate.  It is so easy to reorient the model, and click Capture Camera.  Also, the fact that it creates a Timeline element for the camera rotation makes it easy to edit the movement and time it right in the animation.

I had to create a few IPN files to fully understand the new workflow, but now I love it.  However, I will say that it took me almost a year to find one setting that was bugging me.  Under the old method, users would pull the model apart and the animation would show the assembly of the model.  In the new environment, after the tweaks are made,  the animation shows the model being pulled apart.  Then a few months ago, when I was publishing a video, I noticed an option that would allow you to record the animation in reverse (see image).  Thus, giving me an animation in-tune with the old method.



For those of you that may not have seen the new Presentation Environment in action, or are still struggling to understand how it works, here is a video that shows the new animation and snapshot workflows.

Friday, April 28, 2017

Autodesk Uninstall Tool

It is that time of year again, where the new versions of Autodesk products are available for download and install.  Which can be great and exciting to see what new features Autodesk has added to your favorite products and to see what annoying bugs have been fixed.  However, this time every year users also start considering if and when they should uninstall the old versions of the products they use every day.  Most users don't uninstall them because it is a pain to use the Window's Control Panel to uninstall all of the old versions product-by-product.

Did you know that about 4 years ago, Autodesk began including an uninstall tool with the suite installs?  Initially, it was only for that year's release, but has evolved to a tool that can uninstall anything and everything that is Autodesk related from your PC by selecting programs from a list and hitting "Uninstall."

The Autodesk Uninstall Tool is found under the Window's Start Menu, under the Autodesk folder.  The program itself it not very flashy, but will list all Autodesk products that are currently installed.  All you have to do is select the products to remove and click "Uninstall."  The utility will uninstall each selected product.  This is definitely my preferred method to having to use the Window's Control Panel to uninstall everything program by program, which when you are dealing with a suite or Industry Collection can be a lot of work.

Here is a quick video that shows how to use the Autodesk Uninstall Tool.

Thursday, March 2, 2017

iLogic: Driving the Model from the Drawing

I was teaching a class the other day when a student posed an interesting question.  He wanted to know if there was a way to drive an Inventor model from the drawing.  In the workflow he was trying to create, a sales person could generate proposal drawings by entering the needed parameters.  This way the user didn't even have to open the model.

I thought about ways to make that happen and iLogic seemed to be the easiest solution.    I was not 100% certain that I could get the drawing to update properly when the parameters were passed, so I wanted to test.  While testing, I found a way around that if the model does not cooperate.

The setup is simple.  You create a part or assembly that is driven by parameters, a typical iLogic workflow.  You then just need to create the same parameters in the drawing.  Then you can create a rule that passes the parameters between the drawing and the model.

Here is some sample code:

modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)

Parameter(modelName & ".RailLength")= RailLength
Parameter(modelName & ".RailHeight") = RailHeight
Parameter(modelName & ".Color") = Color
Parameter(modelName & ".NoIntermediatePosts") = NumberOfPosts

iLogicVb.RunRule(modelName, "Update")

The first line finds the oldest view on the drawing and grabs the name of the model represented in that view.  This becomes important when using Copy Design, Replace Model Reference, or some other method that might change the model referenced in the view.  The file name is how the model is listed in the browser, which is how iLogic identifies the model.  The next four lines pass the drawing parameters to the model.

The last line is a way to get the model to update, if it does not automatically update.  It is a way of running a rule in the model that is there solely for the purpose of updating the model.

Here is a Screencast video where I show how this works on a sample model.



I will state that I was verifying this on several models.  I found that models that were using a component from the Frame Generator seemed to not update automatically, and didn't always respond to the extra rule that forced the update.  So any model that is using a Frame Generated component may need some extra effort to get updated.  I still have not found a foolproof way to accomplish the needed updates. 

Monday, February 13, 2017

VR for Total Beginners

I still remember when Virtual Reality (VR) became a big deal in the 1990s.  It's kind of funny how it seemed to go away for a while.  There really wasn't much talk about it in the early 2000s.  However, it seems to be back, and is a quickly growing technology.  I am not 100% sure why VR is making this strong comeback, perhaps it has something to do with accessibility though products like Google Cardboard.

There is so much talk about VR in world of CAD, and it is a little intimidating to try to figure out how to get started.  For years, rendering a CAD model in Inventor Studio, Showcase, or 3DS Max was the end goal for getting a rendering for customer presentations, web sites, etc.  However, I am seeing a push to VR for customer presentations and renderings.  Autodesk makes products like VRED and Stingray that enable users to create high-end VR experiences.  Those are both great products with a lot of great capabilities.  However, both require time and effort to learn.

Over the last few months, I have learned to create Stereo Panoramas using a variety of models from Autodesk software, such as Inventor, Fusion 360, Revit, and InfraWorks 360.  I would classify Stereo Panoramas as entry level VR.  They are immersive and require very little effort beyond the 3D model that you already have.  However, they do have their limitations, such as, they are a static image and offer no interaction with the model.

Depending on the product your 3D model was created in, you will have different ways to create a stereo panorama.  If you created a 3D model in Revit, AutoCAD, or Fusion 360, you can create views of the models, or cameras, then you can reprocess the render in the cloud as a stereo panorama.  If you are modeling in Inventor, InfraWorks 360, or other Autodesk product.  Your model can be Appended to a Navisworks model.  From Navisworks, you will be able to render your model in the cloud as a stereo panorama.

Here is the workflow for Inventor


Here is the workflow for InfraWorks 360


Here is the workflow for Revit


If the purpose of the render is to share the model with potential customers, a QR code can be generated, which will allow them to view the stereo panorama on their cell phone, with the help of Google Cardboard type device.  In a competitive environment, offering this type of conceptual model can be a key differentiator.

Here is how to share rendered Stereo Panoramas

Here are some samples of Stereo Panoramas from various Autodesk products.








Wednesday, January 4, 2017

As-Built Verification with ReCap 360

Some months ago, MESA was asked to do some as-built drawings for a customer that had us do the original assembly modeling in Inventor.  I saw this as a great opportunity to bring together the original model with a ReCap point cloud.  Through the process, I learned a few valuable lessons about the process and feel this is a good opportunity to share those lessons.

The first step in the process was to take the photos of the equipment.  From all my previous work with ReCap I knew that we wanted to take pictures from around the model, making a ring around the equipment, and pictures from different elevations.  One of my co-workers, Mike has a nice camera, so we got a ladder and started photographing the model.  We knew that ReCap has a limitation of 250 photos per model, and by chance, Mike took exactly 250 photos.

I took the photos and began creating the model.  I used a few measurements to ensure that the model would be scaled properly.  Looking at the point cloud from my first attempt, I was surprised that it seemed to have an issue with the back of the machine.  After thinking about it for a while, I realized why.  The decal on the front and back of the tank are the same, and since the tank is symmetrical, ReCap interpreted some of the photos of the back of the tank as being from the front.

My remedy to this was to split the photos into two groups, Group #1 was photos from the front and the two ends.  Group #2 was photos of the back and two ends.  So, then I was able to create point clouds for both portions of the equipment.  At that point, I had two options, create one ReCap project bringing in both the front and back point clouds, or bring both into the Inventor model.  I chose to bring them both into ReCap because that gave me the ability to create regions of points, which can be used to turn off unnecessary points.

Once all of that was done, I was ready to bring the point cloud into an Inventor assembly I created for the purpose of comparing the Inventor model to the point cloud.  I discovered something when I did this that I did not anticipate.  Even though, I had the model scaled properly and had the origin where I wanted, my point cloud was not flush to the origin the way I had hoped.  There are ways to tweak the point clouds orientation in Inventor, but the method of doing this was tedious to say the least.  I could perform some measurements to see how many degrees I needed to rotate the point cloud around its origin, then repeat for another axis, only to find that the previous axis would need adjusted.

The solution to this was to take better control of the orientation of the point cloud when registering points in the photos.  Instead of just assigning an origin point, I could give coordinates to the four corners of the equipment.  Doing this will improve the orientation of the point cloud and provide the scaling information for the point cloud as well.

With all of these lessons learned, I was able to develop a good workflow for bringing all of this together.

 Here is a Screencast that shows how to register the photos with the coordinate points.



Here is a Screencast that shows how to use Regions to clean up the data before bringing it into Inventor.



Here is a Screencast that shows how to bring the Inventor model together with the point cloud.



The workflow to perform the As-Built verification is not difficult, but if you follow this process, it will become easier.