Wednesday, August 28, 2013

New Translation Tool!

To all viewers of this blog; I have added a tool to translate this blog to many different languages.  I want any and all to be able to read and understand the topics that are being discussed on this blog, so I hope that this helps and makes it a little easier for you to be able to read my blog.

Remember, if there is any questions that you have about AutoCAD or anything else drafting related please post questions or if you need something clarified in any of the other posts please post a comment and let me know what you are needing help with.

Thank you!

Breakdown of the Macro for the Attributed block...

So, I gave you the macro for the attributed block but didn't break it down and show how it works.
Well, I am going to remedy that with this post, so this is for you Designers out there that are learning Diesel Macros for AutoCad LT.

*^c^cattdia;0;_.insert;station2;\;1;\;;setvar;userr1;$m=$(+,$(getvar,userr1),$(getvar,userr2));setvar;userr3;$m=$(+,$(getvar,userr3),$(getvar,userr4));
Notice what the text that I have made bold and italicized in the code above;  remember I said that this command will repeat until you hit escape.  That is due to the asterisk that is at the beginning of the code.  If you don't want the command to repeat then remove the asterisk.  (FYI: If you are wanting to insert a block and have it explode after insertion then place an asterisk at the beginning of the block name.)

*^c^cattdia;0;_.insert;station2;\;1;\;;setvar;userr1;$m=$(+,$(getvar,userr1),$(getvar,userr2));setvar;userr3;$m=$(+,$(getvar,userr3),$(getvar,userr4));
Now in this grouping we are telling Autocad to turn off the attribute dialog box when inserting the block and put the attributes through the command line.  This is done by the "attdia;0;".  On to inserting the block; notice the there is an underscore and a period before the insert command and this is so that the command is more versatile between versions and even languages.  After the command we call out the name of the block; then the first "\" is to call for user input for the insertion point.  The "1" is to tell it the scale for "xy", and then the next "\" is for user input on the rotation of the block.  Now notice the last two semicolons in this grouping remember we changed it to where the attributes would be defined through the command line; those semicolons are entering through the attributes because they are being driven by the diesel expression built into them.

*^c^cattdia;0;_.insert;station2;\;1;\;;setvar;userr1;$m=$(+,$(getvar,userr1),$(getvar,userr2));setvar;userr3;$m=$(+,$(getvar,userr3),$(getvar,userr4));
Now to the fun part of the code, the Diesel Expressions!  We start off by telling Autocad that we are going to set the variable or userr1; and then the "$m" is telling autocad that we are going to pass it a diesel expression. (This is one of the odd things of Diesel Expression; the use of dollar signs in front of everything)
To start we are telling autocad that we are wanting to do an addition function where we are taking userr1 and adding userr2's variable to it.

*^c^cattdia;0;_.insert;station2;\;1;\;;setvar;userr1;$m=$(+,$(getvar,userr1),$(getvar,userr2));setvar;userr3;$m=$(+,$(getvar,userr3),$(getvar,userr4));
So, this set is setup the exact same way as the previous grouping the only difference is that we are defining userr3 and then telling it to add userr4 to it.

Hope this helps to more understand the functionality of the code and maybe help out with your understanding of how diesel expressions are created.

Tuesday, August 27, 2013

Diesel Expression in Attribute Fields

Okay, so this is my answer to a question that I saw on cadtutor.net, and I thought that it would be a good topic for a post because I am sure that there are others out there that could use this or something similar to this.  So, today we are going to set up an automated block to increment station number and the elevation of that station.  We are going to do this by setting up a couple of attributes with built in diesel expressions.  
The first attribute is going to be our station number, so (as in the picture below) fire up the attribute definition and in the "Tag" field enter in Station; and then in the default pick the field button to the right of the text box, and then follow the pictures below.

once you are to the "Other" category; we are going to pick on the "DieselExpression" field name, and then enter the diesel expression seen in the picture in the field box.

Once you finish that pick okay, and then make sure the rest of the options are to your liking for the attribute definition and then go ahead and pick okay to place the attribute on your drawing.  Next we will repeat the process for the elevation attribute.
Notice that in this diesel expression field that the "userr" variable is different from the station number variable.  Make sure that you do this or you might have some confusion in the program when trying to place the block.


The picture below is what the (2) attributes should look like when you are done.  Now, once you have this we are going to select the attributes and then run the "Wblock" command.  When you pick the basepoint, pick the bottom left of the elevation attribute.

Now, that we are finished with establishing the block let's get on with the macro.  This macro is set up for LT users, but works no matter which Autocad you have.  If you notice, I named my block "station2" you can name it whatever you want just make sure that you change the name in the macro as well.

*^c^cattdia;0;_.insert;station2;\;1;\;;setvar;userr1;$m=$(+,$(getvar,userr1),$(getvar,userr2));setvar;userr3;$m=$(+,$(getvar,userr3),$(getvar,userr4));

Once you have assigned the macro to a new command button and get it placed on a toolbar or ribbon; you are set to insert your new expressive block...wait a minute...there is one more thing that has to be set up before you can run away with it.  When you are in the drawing that the block is going to be placed in, and before you run the command.  You need to go through and define the variables in your "userr1", which is your starting station number; "userr2", which is the increment that your station number will increase by each time you place the block; "userr3", this is your starting elevation; and last but not least "userr4", and this will be the value that your elevation is going to increase by each time you place the block.

Okay that is it...have fun placing blocks!

Sunday, August 25, 2013

New Commands/Variables for AutoCAD LT 2014

Here is some good news for you LT users out there.  With the newest release comes some new system variables and new commands available to The LT users.  See the link below for a complete list of the newest additions.

LT is still AutoCAD: AutoCAD LT2014 New Commands/Variables

Friday, August 23, 2013

ThreadModeler App. for Autodesk Inventor

I don't know how many of you have used the app exchange that is available for a lot of Autodesk Products, but there are some great tools in there for designers.  Today I am going to highlight one of the tools and the app is called ThreadModeler.  This is an awesome tool for you Inventor animators out there especially if you use publisher.  When using the ThreadModeler app you can take a bolt that has an image of threads and it will actually cut out the threads for the bolt so you have an actual representation of the threading.
let's start with where to find it
With Inventor launched you will go to the "Tool" panel on your ribbon bar and then select the exchange app manager.

Once you have the website launched you can find the threadmodeler app 1 of 2 ways; either off to the right side of the page there is a "most downloaded" panel and typically it should be on there.  If you can not find it on there then go to the search bar and type in threadmodeler into the search bar.

Once you find it and get direct to the page to download it you will just have to pic whether you have win 32/64 and the language and then click on the free button to download it.
Once downloaded; close down Inventor and run the installation.  When the installation is done launch Inventor again.
To test it out start a new part with a cylinder; for mine I created a 1/2" diameter cylinder at 2" long and added the thread feature to the cylinder.

Go to the "Tools" panel again and there you will find the Thread Modeler button.  Pick the button to run the command and then pick the thread feature from the browser bar (can't pick the actual part).
The program inputs the information it needs and all that is left is for you to click the "OK" button for it to do its thing.  Below is my finished product.
 Like I said before; this would be a great app for those of you out there that do a lot of animations for product construction.  It would give a great visual for the customer to see the bolt actually turning in animation.

Thursday, August 22, 2013

New Collaboration tool from Autodesk!

Autodesk Fusion 360 is the newest collaboration tool from Autodesk.  It allows for all members of a project to collaborate together no matter where you are.  Each person can mark their own comments on parts and assemblies all while the design is doing his/her thing.  I can see this being a great tool for prototype shops and for think tanks.  See the link below for a video that shows the flexibility of this new product.

https://www.youtube.com/watch?v=8760W4PIob0

Thursday, August 15, 2013

Diesel Macro Letter Automation...broken down

I realized that i had posted the diesel macro for letter automation, but didn't really go into the breakdown of the functionality of the macro.  So, here is my attempt at breaking it down...first let's look at the macro that was written again.

*^C^C_text;\;$m=$(if, $(<=,$(getvar,userr1),7),$(nth,$(getvar,userr1), A, B, C, D, E, F, G, H),$(if,$(>=,$(getvar,userr1),8),$(nth,$(getvar,userr3), I, J, K, L, M, N, O, P)),)$(if,$(>=,$(getvar,userr1),15),$(nth,$(getvar,userr4), Q, R, S, T, U, V, W, X),)$(if,$(>=,$(getvar,userr1),23),$(nth,$(getvar,userr5), Y, Z, AA, AB, AC, AD, AE, AF),);setvar;userr1;$M=$(+,$(getvar,USERR1),$(getvar,USERR2));setvar;userr3;
$M=$(+,$(getvar,USERR3),$(getvar,USERR2));
userr4;$M=$(+,$(getvar,USERR4),$(getvar,USERR2));
userr5;$M=$(+,$(getvar,USERR5),$(getvar,USERR2));
SETVAR;USERR3;\SETVAR;USERR4;\SETVAR;USERR5;\

First, we know that you start with the text command and go through all the prompts for it.  Then we work our way into the diesel portion of the macro...so, when developing this I found out that when using the "nth" function by itself you were limited to 7 arguments within the function.

Hence, why I embedded the "nth" function within multiple if statements.  
 Let's dissect these if statements a little:
 $m=$(if, $(<=,$(getvar,userr1),7),$(nth,$(getvar,userr1), A, B, C, D, E, F, G, H),$(if,$(>=,$(getvar,userr1),8),$(nth,$(getvar,userr3), I, J, K, L, M, N, O, P)),)

 so, in this first "if statement" I am telling it to evaluate the value of userr1.
$m=$(if, $(<=,$(getvar,userr1),7),$(nth,$(getvar,userr1), A, B, C, D, E, F, G, H),$(if,$(>=,$(getvar,userr1),8),$(nth,$(getvar,userr3), I, J, K, L, M, N, O, P)),)

 If a value of 7 or less is returned then it moves on to this nth function where i am again calling for the value of userr1.
 $m=$(if, $(<=,$(getvar,userr1),7),$(nth,$(getvar,userr1), A, B, C, D, E, F, G, H),$(if,$(>=,$(getvar,userr1),8),$(nth,$(getvar,userr3), I, J, K, L, M, N, O, P)),)

 you will find a recurring theme throughout these if statements that we are evaluating the value of userr1...here we are looking to see if the value of userr1 is greater than or equal to 8.
 $m=$(if, $(<=,$(getvar,userr1),7),$(nth,$(getvar,userr1), A, B, C, D, E, F, G, H),$(if,$(>=,$(getvar,userr1),8),$(nth,$(getvar,userr3), I, J, K, L, M, N, O, P)),)

 If it returns a value of 8 or greater then it will move on to the next nth statement where we call for the value of userr3.
 And this process repeats 2 more times with userr4, and userr5.  One thing that you should notice is that the value to be returned from userr1 increase by a value of 8 with each "if statement".
 Now that we are done with the if statements we can move  on to the easier portions of the macro...how the values of the userr variables increase with each repetition of the command.
 setvar;userr1;$M=$(+,$(getvar,USERR1),$(getvar,USERR2))
 This code will be repeated four times...you will just have to copy and paste and then replace userr1 with userr3, userr4 or userr5.
 And then the prompting for user input of the userr variables finishes out the macro.


 Hope that this helped to clarify the process of the macro.

Thought of the Day...(8/15/13)

If you are writing a lisp routine and you are trying to figure out if a command can be used in a lisp routine; try this...in the command line start by typing in a dash and then the command.  For example...if you are wanting to create a new layer.  In the command line type "-layer", then all the options show in the command line; Then just follow the prompts.
And at the end of it; if you are setting linetype, lineweight, color and the such...this is an example of what you will see...
-LAYER;NEW;D_EQ;LTYPE;CONTINUOUS;D_EQ;LWEIGHT;.020;D_EQ;COLOR;11;D_EQ;;

If you have "Dynamic Input" turned on then it is easy to see what commands you can use the "-" in front of.

Wednesday, August 14, 2013

Linking Dimensions in 2 Visible States on a Dynamic Block

I saw a question on a forum asking about making length dimensions on 2 different visible states equal each other.
For this example I am going to use an I beam block:
In the picture below you will see that the i beam is in a side view orientation.  Here we are wanting the dimension "Length_zaz"' to be able to control the length of the block in this visible state and in the top view which will be seen in the next image.   So, first in the parameters palette we will add a user parameter and call it length; and make the parameter link to our main length dimension.


Next we will change the visible state to the top view of the i-beam and then make its dimension link to the user parameter 'length' that we create.  Make sure that our main length dimension is visible in this state as well because this is what is going to allow us to adjust the length of the beam in either view.  Save the block and exit out of the block editor.


Now you can adjust the length of your beam in either visible state and it will translate to both visible states.
Hope this is helpful!

Friday, August 9, 2013

Revision Cloud in Inventor...

How many of you wish there was the ability to put a revision cloud on a change on a drawing in Inventor?  Me too.  I have been working with Inventor for a long time and didn't know this was available at all.  There is a way to install some usertools that will allow you to be able to create revision clouds on drawings.
Follow the steps below to install the tools:

First open a windows explorer page; and put the path below into the address bar.
C:\Users\Public\Documents\Autodesk\Inventor 2013\SDK
Once you are in that folder find the file that is called UserTools.msi; double pick on this file to run the installer.
be sure that Inventor is closed when you are doing this.
Once the installer is done...boot up Inventor and open a file.  Then go to the add-ins tab, and wallah...there you have the ability to create revision clouds.

Question for the piping designers out there

So, let's just say that curiosity is eating at me.  From the people that view this page; I am curious as to how many of you are piping designers?
And out of the piping designers out there; who uses SolidWorks as your primary design tool for piping assemblies?

I was presented a product yesterday that I had not heard of before, and it was a third party program that attaches to SolidWorks called Smap 3D.  After looking into it further and even downloading the free trial version (which I am looking forward to fiddling with later on).  I am curious how many of you out there have heard of this program and/or use it?

Please give some feedback on your experiences with it if you have any or what have you.


Thursday, August 8, 2013

Creating a SolidWorks Drawing template linked to custom properties

Okay…so, here is a post for the SolidWorks users out there.
I know recently at the company I work for and I have heard others ask this; the question for today is “How do you link a custom property in a part or assembly to a drawing file?”
I am going to demonstrate how to link a custom property from a part file into a drawing file.
  1. Let’s start of by starting a new part.
  2. Create a sketch on the front plane; and just create a box…don’t want anything fancy just a basic shape.
  3. Save the file to your desktop or wherever you know you will be able to find it.
  4. Then go into the properties manager and then click on the custom properties tab.
  5. And create all the custom properties you want. (fill in the values of some of them, so that we can make sure they work once we link them to the drawing file.)
  6. Save the part file
  7. Next we are going to start a new drawing, and when that comes up place a random view of your part that you created.
  8. Now, we get into the fun stuff.  Once the part view is placed; go in and select your sheet format and right click on it and pick edit sheet format. 
  9.  Now as shown in the Image 1; you will double pick on one of the textboxes that you are wanting to link to a custom property.  Then you will want to go to your side bar and pick on the ‘Link to Property’ button.
  10. In Image 2; pick the radio button labeled 'Model in View Specified in Sheet Properties'
  11. Then pulldown the listbox and pick the custom property you are wanting to link to.
  12. Lastly pick the okay button.
Now we are almost done...return back to the top level of your drawing file and go ahead and delete that part view.  Then you will save it out as a SolidWorks drawing template.
Now, go back to your part file and erase the feature that you created; then do a 'save as template' in your part file to create a part file template that already has your custom properties setup.

And now you have custom part and drawing templates.  The same can be down with assembly files as well.

Image 1
Image 2

Wednesday, August 7, 2013

Importing Page Setup from another drawing file (AutoCAD)

One of the things that I took on at the company that I am currently working with is build a bunch of macros that would make the design process easier.  So, the first one that I created was a macro that would insert the companies titleblock in a drawing, import a page setup that was defined in a different drawing, create all the layers required for a given discipline, create a new viewport, and then at the end would go through the edit attribute for the title block. 
Today, I want to take a look at how you can import a page setup from one file to another, and how to set a given page setup as your plot parameters.
So, below is an example of what the code would look like...
^c^c-psetupin;"D_SIZE-PID.DWG" "*";^c^c-plot;n;layout1;11x17;;n;y;n;


First, I want to point out just incase you don't know...at the beginning of each command you will see "^c^c" this is just telling the program to cancel out of any commands that it may be in at that point.
Next, we have the command "-psetupin"; and then the semicolon is issueing an enter command in the macro.
Then you will pass the macro the name of the drawing that you are wanting to get the page setup from and in my example I am calling out "D_size-pid.dwg" and you have to make sure that it is in the quotations.  Also, as long as the file location of the drawing is setup in your search paths then you don't have to worry about adding the whole location of the file just the nam will suffice.  The asterisk after the file name just tells it to select all the setups that are associated with that file.
Then, we move on to setting a specific pagesetup to our layout.  With this we begin with "-plot" which will do all the plot settings through your command line.  After starting the command the first question is asking if you want to do a "Detailed plot configuration"...we want to put "no". 
Then you will tell it which layout you want to apply the pagesetup to; mine is "layout1", and then type in the page setup that you are wanting to apply "11x17".  After the page setup name there are 2 semicolons; the first represents the issueing of an enter command, and the second of these represent a question that follows after the setup name...this is for the output device (printer name), and as long as that is set properly in your setup then you should just have to issue an enter command. 
Then it asks if you want to plot to file and for that we want to say "no" as well and it should default to that, but just incase we will put an "n"; and then it asks if we want to save changes to page setup, and for this you will enter a "yes". 
The last question is if you want to go ahead and plot and for mine a said "no".
Now, after all that you should end up with something like this...
-plot;n;layout1;11x17;;n;y;n;

Good luck and hope this helps!

Environment Variables within AutoCAD

When setting environment variables there are different ways of setting them depending on whether you are using full version AutoCAD or AutoCAD LT. To set an environment variable in AutoCAD you use the command...USERSx. X represents numbers 1-5. With AutoCAD LT you have to use...setenv. There are different environment variables when using this command. A couple of them are StrPrefix, and StrSuffix. You can use these with the diesel macros from the last couple posts for automated numbering.

Embedded Macros and how to remove them when not visible...

Not too long ago we ran across an issue with some drawing files from Autocad that we had sent to a customer that would show an error dialog box saying that there were embedded macros in said drawing file.  Well, the customer that we were providing the drawings for said that it was unacceptable and that we need to fix it.  Well, none of our designers had dealt with this issue before.  So, I researched it and was able to right a macro that would unbed the vba macro from the drawing files.
Below is the code that I had created, and all you do once you assign it to a button, is click the button and it does all the work for you.

^C^C(dictremove(namedobjdict)"ACAD_VBA");

Friday, August 2, 2013

Inventor Dynamic Simulation...

So last night I decided to mess around with Dynamic Simulation in Autodesk Inventor, and the video below is what I ended up with.  I watched a video of someone simulating the motion of a trebuchet, so I decided that i was going to build a very basic catapult and see if I could get the simulation to work on it.  So, below is my very basic catapult with the simulated arm motion and ball being thrown.