Wednesday, August 28, 2013

New Blog Location...

There will be no more new posts on this blog after this one.  We would like you to follow us to our new blog which is www.talkaboutcad.blogspot.com...  We desire to share tips, tricks, new macros, or just general cadding information a couple times a week, so please visit our new blog frequently to see what is new!

Thank you!

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.

**fixed text visibility on the given background.

Thursday, August 1, 2013

Check out our Company Site!

Please visit our company site.  On there you will find out who we are and what we do. 
May be you have a project or some standard development task that you need to get complete, but don't have the time to.  Fill out the contact us form and let us know what your project is and maybe we could help you out.
Also, if anyone has any technical questions dealing with AutoCAD, Inventor or SolidWorks we can help.  Send us an email and then we can create a post on this blog covering the issue.

cadconsultingllc.weebly.com

Email address: cadconsultinginc@gmail.com

Thank you!

Tuesday, July 16, 2013

SaveAs Rule in Inventor ilogic

I use Inventor ilogic whenever possible, but one thing that has caused me problems is the fact that I couldn't save out a modified ilogic assembly without screwing up other drawings that were attached to that assembly...that is until now...
With the help from another blog; I was able to create a rule in ilogic that would perform a saveas off the assembly and then in turn would also run the rule under each part to create a brand new assembly and brand new parts within the assembly so that if you were to modify the main assembly this would not be affected by those changes.

Below is the code required for the saveas of an assembly:

'define the active document
oDoc = ThisDoc.Document
'create a file dialog box
Dim oFileDlg As inventor.FileDialog = Nothing
InventorVb.Application.CreateFileDialog(oFileDlg)

'check file type and set dialog filter
If oDoc.DocumentType = kPartDocumentObject Then
oFileDlg.Filter = "Autodesk Inventor Part Files (*.ipt)|*.ipt"
Else If oDoc.DocumentType = kAssemblyDocumentObject Then
oFileDlg.Filter = "Autodesk Inventor Assembly Files (*.iam)|*.iam"
Else If oDoc.DocumentType = kDrawingDocumentObject Then
oFileDlg.Filter = "Autodesk Inventor Drawing Files (*.idw)|*.idw"
End If

'set the directory to open the dialog at
oFileDlg.InitialDirectory = ThisDoc.WorkspacePath()
'set the file name string to use in the input box
oFileDlg.FileName = iProperties.Value("Project", "Project") & "_" & iProperties.Value("Summary", "Title")

'work with an error created by the user backing out of the save
oFileDlg.CancelError = True
On Error Resume Next
'specify the file dialog as a save dialog (rather than a open dialog)
oFileDlg.ShowSave()

'catch an empty string in the imput
If Err.Number <> 0 Then
MessageBox.Show("No File Saved.", "iLogic: Dialog Canceled")
ElseIf oFileDlg.FileName <> "" Then
MyFile = oFileDlg.FileName
'save the file
oDoc.SaveAs(MyFile, True) 'True = Save As Copy & False = Save As
End If

Now in my example; I have created a custom naming convention of the assembly that is controlled by the Project value, and the Title value within the iproperties. (shown below)
oFileDlg.FileName = iProperties.Value("Project", "Project") & "_" & iProperties.Value("Summary", "Title")
Now, to cause the parents under the assembly to saveas with predetermined values run the part rule within the assembly. (shown below)
iLogicVb.RunRule("2x4tube_1:1", "saveas")

When you run the rule it will automatically open a SaveAs dialog box for the assembly and once you hit save it will start running the SaveAs dialog for all the parts in the assembly that you call for the "RunRule".

Tuesday, March 12, 2013

Changing text style font with a Macro...

I know that one thing some people have problems with is when you xref or insert a title block into a drawing file; the text style changes back to the original font type.  This was happening with the title block that our company is standardizing.  So, I came up with a quick fix for our design group to take the standard text style and change the font type to the proper font so that the text would look the way it was meant to.

Here is the macro:
-STYLE;STANDARD;Arial Unicode MS;.125;;;;;

So, first in this code is obviously the command; which in this case is our text style command.  Then you will list the text style that you are wanting to change; next will be the font style that you are wanting to change it to, and then finally the height of the text.  Last there are a bunch of semi-colons attached to the end of the code to enter through other questions that comes with changing the text style, but none of them applied in this case.

Below is an example of this being used in one of my titleblock macros for inserting a title block and creating new layers for discipline specific drawings:

^C^C-STYLE;STANDARD;Arial Unicode MS;.125;;;;;ATTDIA;0;layout;set;layout1;
^C^C-insert;D-SIZE_BOTTOM(22X34)(REV_D);0,0;XYZ;1;1;1;0;;;;;;^C^C-INSERT;*REV-TEXT.DWG;0,0;1;0;^c^cpsetupin;"D_SIZE-PID.DWG" "*";

^c^c-plot;n;layout1;11x17;;n;y;n;
-LAYER;NEW;D_EQ;LTYPE;CONTINUOUS;D_EQ;LWEIGHT;.020;D_EQ;COLOR;11;D_EQ;;
-LAYER;NEW;D_PR;LTYPE;CONTINUOUS;D_PR;LWEIGHT;.030;D_PR;COLOR;14;D_PR;;
-LAYER;NEW;D_UT;LTYPE;CONTINUOUS;D_UT;LWEIGHT;.015;D_UT;COLOR;9;D_UT;;
-LAYER;NEW;D_FIT;LTYPE;CONTINUOUS;D_FIT;LWEIGHT;.015;D_FIT;COLOR;7;D_FIT;;
-LAYER;NEW;D_INST;LTYPE;CONTINUOUS;D_INST;LWEIGHT;.010;D_INST;COLOR;4;D_INST;;
-LAYER;NEW;D_FUT;LTYPE;PHANTOM;D_FUT;LWEIGHT;.010;D_FUT;COLOR;6;D_FUT;;
-LAYER;NEW;D_EXIST;LTYPE;DASHED;D_EXIST;LWEIGHT;.010;D_EXIST;COLOR;5;D_EXIST;;
-LAYER;NEW;D_TXT;LTYPE;CONTINUOUS;D_TXT;LWEIGHT;.015;D_TXT;COLOR;7;D_TXT;;

-LAYER;NEW;VIEWPORT;COLOR;211;VIEWPORT;PLOT;NO;VIEWPORT;;
^C^C_EATTEDIT;7.153207,1.737254,0.000000;^C^C-LA;SET;VIEWPORT;;^c^c-vports;1,21.4999;27.5,2;^C^C-LA;SET;D_PR;;^C^C_.INSERT;LOGO-CALLOUT;18.25,1.375,0;XYZ;1;1;1;0;-DIMSTYLE;R;EPIC;^C