Update copied properties command

Update copied properties command

nvmierlo
Contributor Contributor
840 Views
1 Reply
Message 1 of 2

Update copied properties command

nvmierlo
Contributor
Contributor

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

0 Likes
841 Views
1 Reply
Reply (1)
Message 2 of 2

Zach.Stauffer
Advocate
Advocate

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?

0 Likes