Code not working in 2018

Code not working in 2018

jletcher
Advisor Advisor
876 Views
13 Replies
Message 1 of 14

Code not working in 2018

jletcher
Advisor
Advisor

Looks like some things in ilogic has changed from 2012 to 2018.

 

without steps in the coding to find the issues I am lost what might have changed.

 

Here is the code maybe someone already knows and can educate me.

 

Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

Dim oDrawDoc as DrawingDocument    
Dim oPartDoc as Document
Dim oSheet As sheet
Dim oTG As TransientGeometry
Dim oBaseView As DrawingView
Dim opath As String
opath = ThisDoc.WorkspacePath()

ViewScale = 1/64

'Make Drawing
    oPartDoc = ThisDoc.Document
    
    'Define IDW Template File Location
	oDrawDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "C:\Users\engineer\Desktop\Inventor 2018 code\625 Temps", False)
    oSheet = oDrawDoc.Sheets.Item(1)
    
    'Define 2d view bottom left corner points
     oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)
	 
  
    
	oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, 1/64,kFrontViewOrientation, kHiddenLineDrawingViewStyle, "Default")
    
	
	oDrawDoc.SaveAs(opath & "\" & "625A1-" & Letter_Code & Mat_Code & L_1 & ".idw" , False)
	oDrawDoc.Close(False)
	

 

Thanks

 

 

 

 

0 Likes
Accepted solutions (1)
877 Views
13 Replies
Replies (13)
Message 2 of 14

bradeneuropeArthur
Mentor
Mentor

try this

 

Scale as Double:

And oPoint1 as Point2d

 

Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

Dim oDrawDoc as DrawingDocument    
Dim oPartDoc as Document
Dim oSheet As sheet
Dim oTG As TransientGeometry
Dim oBaseView As DrawingView
Dim opath As String
Dim oPoint1 As Point2d opath = ThisDoc.WorkspacePath() Dim ViewScale As Double ViewScale = 1/64 'Make Drawing oPartDoc = ThisDoc.Document 'Define IDW Template File Location oDrawDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "C:\Users\engineer\Desktop\Inventor 2018 code\625 Temps", False) oSheet = oDrawDoc.Sheets.Item(1) 'Define 2d view bottom left corner points oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(0, 0) oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, ViewScale,kFrontViewOrientation, kHiddenLineDrawingViewStyle, "Default") oDrawDoc.SaveAs(opath & "\" & "625A1-" & Letter_Code & Mat_Code & L_1 & ".idw" , False) oDrawDoc.Close(False)

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 14

jletcher
Advisor
Advisor

No sir still fails

 

Fail 1.JPGFail 2.JPG

 

 

0 Likes
Message 4 of 14

bradeneuropeArthur
Mentor
Mentor

I have edit the post.

Opoint1 as point2d

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 14

bradeneuropeArthur
Mentor
Mentor
By me it is working now

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 14

bradeneuropeArthur
Mentor
Mentor
Please copy the complete code into your project.

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 7 of 14

jletcher
Advisor
Advisor

I did but still fails

 

Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

Dim oDrawDoc as DrawingDocument    
Dim oPartDoc as Document
Dim oSheet As sheet
Dim oTG As TransientGeometry
Dim oBaseView As DrawingView
Dim opath As String
Dim oPoint1 As Point2d

opath = ThisDoc.WorkspacePath()

Dim ViewScale As Double
ViewScale = 1/64

'Make Drawing
    oPartDoc = ThisDoc.Document
    
    'Define IDW Template File Location
	oDrawDoc = ThisApplication.Documents.Add(kDrawingDocumentObject, "C:\Users\engineer\Desktop\Inventor 2018 code\625 Temps", False)
    oSheet = oDrawDoc.Sheets.Item(1)
    
    'Define 2d view bottom left corner points
     oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)
	 
  
    
	oBaseView = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, ViewScale,kFrontViewOrientation, kHiddenLineDrawingViewStyle, "Default")
    
	
	oDrawDoc.SaveAs(opath & "\" & "625A1-" & Letter_Code & Mat_Code & L_1 & ".idw" , False)
	oDrawDoc.Close(False)
0 Likes
Message 8 of 14

bradeneuropeArthur
Mentor
Mentor
Letter_Code & Mat_Code & L_1 

 

Is this missing? 

 

For me the code is working.

But I have disabled this line. Because I don't know what those parameters are.

 

So till this line it is working.

 

 

 

 

Try also to disable this line. And then check if it is working 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 9 of 14

jletcher
Advisor
Advisor

The parameter is there but I disabled and tried still fails.

 

I have 6 rules all work but this one making the drawing.. And that same L_1 is in the part number rule and it makes the part does all right up to making drawing.

 

I wish I could upload the part but I can't...

 

I can't get cleared to upload from client...

 

 

 

 

0 Likes
Message 10 of 14

bradeneuropeArthur
Mentor
Mentor
Accepted solution

I think I found it.

 

You define no template idw file

 

C:\Users\engineer\Desktop\Inventor 2018 code\625 Temps\###.idw

Please check that.

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 11 of 14

jletcher
Advisor
Advisor

Yes you did find it I guess when I copied new path I removed the idw call out...

 

 Nice catch I look at everything and I kept on missing that wow glad I am going on vacation tonight..

 

 

I owe you a beer my  friend..

0 Likes
Message 12 of 14

bradeneuropeArthur
Mentor
Mentor

Send it to Europe...... ha ha ha

 

Nice Holidays and everything else..

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 13 of 14

jletcher
Advisor
Advisor

Where about in Europe my Uncle is there I will have him buy it LOL...

0 Likes
Message 14 of 14

bradeneuropeArthur
Mentor
Mentor
Where is your uncle from?

Maybe we are neighbours!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes