Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get parameter value from Inventor .dwg

1 REPLY 1
Reply
Message 1 of 2
meck
275 Views, 1 Reply

Get parameter value from Inventor .dwg

I'm trying to get a parameter value from an Inventor .dwg file, but I keep getting an error saying the file is not found. I use this same code all over the place between different parts but its the first time I'm tried it using a dwg. Can you not access an Inventor .dwg parameters using iLogic or am I having a Monday morning brain cramp?

 

MsgBox(Parameter(ThisDoc.Path & "\MyDrawing.dwg", "Customer"))

 

 

Mike Eck
Master Drafter/ CAD Programmer
Using Inventor 2018
1 REPLY 1
Message 2 of 2
ALink
in reply to: meck

Try this rule from any part document located in the same directory as your DWG.

(I used model file "cube.ipt")

 

'create file name
Dim DwgFileName As String = ThisDoc.Path & "\cube.dwg"
'open DWG file invisibly
Dim oDoc as DrawingDocument = ThisApplication.documents.Open(DwgFileName, False)
'read user parameter "AAA" value
Dim x As Double = odoc.parameters.item("AAA").Value
'close dwg file without saving any changes
oDoc.Close(True)

'display parameter value
MsgBox(x)

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

Post to forums  

Autodesk Design & Make Report