Community
Inventor Forum
Welcome to Autodesk’s Inventor Forums. Share your knowledge, ask questions, and explore popular Inventor topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CREATE VIEWS WITH I LOGIC

5 REPLIES 5
Reply
Message 1 of 6
twinz3950
350 Views, 5 Replies

CREATE VIEWS WITH I LOGIC

I WOULD LIKE TO CREATE A I LOGIC RULE THAT WILL AUTOMATICALLY PLACE VIEWS OF AN ASSEMBLY ON TO A DRAWING.  I HAVE SEARCHED THE FORUM AND FOUND SOME TOPICS ABOUT THE SUBJECT BUT I STILL CAN NOT FIGURE IT OUT BECAUSE THE SAMPLES THAT I FOUND WERE COMPLEX AND WAS TRYING TO PLACE DIMENSIONS.   ALL I WOULD LIKE TO DO AT THIS TIME IS TO PLACE 3 VIEWS AUTOMATICALLY: TOP, LEFT AND RIGHT VIEWS. I HAVE CREATED AN ASSEMBLY WITH I LOGIC AND I WOULD LIKE A PROMPT BOX TO APPEAR AFTER THE USERS SAVE THE FILE IF THE WOULD LIKE TO CREATE A DRAWING, AND IF THE USER SAYS YES THEN A IDW WILL OPEN AND PLACE THE 3 SPECIFIED VIEWS ON TO THE SHEET. CAN ANY ONE HELP ME AND POINT ME INTO A DIRECTION AS HOW TO START THIS.

 

I am trying to work with this sample code:

 

Format:HTML Format
Version:1.0
StartHTML: 165
EndHTML: 14402
StartFragment: 314
EndFragment: 14370
StartSelection: 314
EndSelection: 314

SyntaxEditor Code Snippet

ImportsInventor.ViewOrientationTypeEnum
ImportsInventor.DrawingViewStyleEnum

DimoDrawingDocasDrawingDocument
DimoPartDocasDocument
DimoSheetAssheet
DimoTGAsTransientGeometry
DimoView1asDrawingView
DimoView2asDrawingView
DimoView3asDrawingView
DimoView4asDrawingView

ViewScale=3/16

'Ask to create drawing?
dwgQuery=MsgBox("Would you like to Create a drawing for this MODEL?", vbYesNo,"Drawing Selection")
IfdwgQuery=vbYesThen
oPartDoc=ThisDoc.Document

'Define IDW Template File Location
oDrawingDoc=ThisApplication.Documents.Add(kDrawingDocumentObject, "Y:\Nemato - Engineering\AUTODESK INVENTOR 3D CAD\Vault Items\NEMATO PROJECT INVENTOR FILES\Templates\NBT", True)
oDrawingDoc=ThisApplication.Documents.Add(kDrawingDocumentObject, "", True)
oSheet=oDrawingDoc.Sheets.Item(1)

'Define 2d view bottom Left corner points For four views
oPoint1=ThisApplication.TransientGeometry.CreatePoint2d(1, 1)
oPoint2=ThisApplication.TransientGeometry.CreatePoint2d(1, 6)
oPoint3=ThisApplication.TransientGeometry.CreatePoint2d(5, 1)

oBaseView=oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, 3/16,kFrontViewOrientation, kHiddenLineDrawingViewStyle)', KTANGENTEDGESON)

oView2=oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint2, kHiddenLineDrawingViewStyle, 3/16)
oView3=oSheet.DrawingViews.AddProjectedView(oBaseView,oPoint3, kHiddenLineDrawingViewStyle, 3/16)

EndIf

 but I keep getting this error  message

 

Error in rule: Rule12, in document: Assembly2 (iLogic)

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))

 

I HAVE ALSO POSTED THIS ON THE INVENTOR CUSTOMIZTION  FORUM BUT HAVE NOT RECEIVED A RESPONSE AS YET.

5 REPLIES 5
Message 2 of 6
jletcher
in reply to: twinz3950

You have posted this in the customize section why are you starting another post in here?

 

 

 http://forums.autodesk.com/t5/Inventor-Customization/PLACE-VIEWS-WITH-I-LOGIC/td-p/4711689

Message 3 of 6
jletcher
in reply to: jletcher

But to take a guess I would say you have no path for the file to go.

 

 

opath = ThisDoc.WorkspacePath()

 

 

 But that is a guess I have not done ilogic for an assembly just parts..

Message 4 of 6
twinz3950
in reply to: jletcher

I posted here as well because I know that this forum gets more traffic and views than the other.
Message 5 of 6
twinz3950
in reply to: twinz3950

OK I CAN GET IT TO WORK WITH OUT SPECIFYING MY TEMPLATE LOCATION, BUT WHEN I ADD MY TEMPLATE LOCATION I GET THE ERROR MESSAGE.
Message 6 of 6
twinz3950
in reply to: twinz3950

Ok I realized my mistake I was not putting the .idw after the file location for the template.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report