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: 

Update copied properties command

1 REPLY 1
Reply
Message 1 of 2
nvmierlo
553 Views, 1 Reply

Update copied properties command

Hello, 

 

I want to update the Iproperties of a drawing file using Ilogic. I have found a section of code for doing so and it works fine however, it does not work when the rule in the drawing file is triggerd from the assembly file. 

 

I am using the following code to trigger the rule in the drawing from the assembly: 

 

Sub GenerateDrawings() 
	'open known drawing document specifying full filename
	FullFilename = ThisDoc.Path & "\" & ThisDoc.FileName(False) & ".idw"
	Dim oDrawDoc As DrawingDocument = ThisApplication.Documents.Open(FullFilename, True)

	'run rule in the drawing document
	auto = iLogicVb.Automation
	auto.RunRule(oDrawDoc, "Drawing configuration")
	'you may also save and close this drawing document
	oDrawDoc.Save
	oDrawDoc.Close
End Sub

 

And then the following code to run inside my drawing file: 

 

InventorVb.DocumentUpdate()
iLogicVb.UpdateWhenDone = True
Dim updateCmd As ControlDefinition
updateCmd = ThisApplication.CommandManager.ControlDefinitions.Item("UpdateCopiedModeliPropertiesCmd")
updateCmd.Execute2(True)

 

Any suggestions to fix this problem? 

 

Thanks in advance! 

Niek

Labels (6)
1 REPLY 1
Message 2 of 2
Zach.Stauffer
in reply to: nvmierlo

Niek,

 

I duplicated your code and it ran perfectly for me, updated all of the properties and saved them. Maybe something else strange going on, like iProperties aren't checked for copying or filenames are incorrect?

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

Post to forums  

Autodesk Design & Make Report