Update drawing Iproperties from Model?

Update drawing Iproperties from Model?

drafting1
Contributor Contributor
1,185 Views
5 Replies
Message 1 of 6

Update drawing Iproperties from Model?

drafting1
Contributor
Contributor

Hi all, 

 

I would like to add a rule to our standard template that would also work on updating current drawings.

 

I would like to try do an ilogic that will set the copy model iproperty setting to copy all properties

Capture.PNG

 

I believe then I can use the following that I can set to trigger once the document opens and saves

Dim oControlDef as ControlDefinition  = ThisApplication.CommandManager.ControlDefinitions.​Item("UpdateCopiedModeliPropertiesCmd")
 
oControlDef.Execute2(True)

 

 

Is it possible to add in the ilogic to set the triggers?

 

1,186 Views
5 Replies
Replies (5)
Message 2 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @drafting1,

 

Yes, procedure is absolutely right.

 

Following link explains about settings of Copy Model iProperties to drawing.

 

https://knowledge.autodesk.com/search-result/caas/CloudHelp/cloudhelp/2017/ENU/Inventor-Help/files/G...

 

Please feel free to contact if there is any doubt.

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 6

drafting1
Contributor
Contributor

Hi, Thanks but I was hoping to add an ilogic that would do the steps instead on manually doing it.

0 Likes
Message 4 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @drafting1,

 

Create a new template drawing with settings of copy Model iPropeties to Drawing.

 

This setting is very important. If any changes in Model iPropeties, then previous code can be used to update iPropeties.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 6

drafting1
Contributor
Contributor

Thats fine to add it to our template but what about updating existing drawings?

0 Likes
Message 6 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

Hi @drafting1,

 

Unfortunately, there is no direct API to copy all Model iProperties at single shot.

 

But Individual model iProperties can copied using following iLogic rule.

 

If (ThisDrawing.ModelDocument Is Nothing) Then Return

modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)

iProperties.Value("Project", "Part Number") = iProperties.Value(modelName, "Project", "Part Number") 

iProperties.Value("Summary", "Title") = iProperties.Value(modelName, "Summary", "Title")

iProperties.Value("Summary", "Subject") = iProperties.Value(modelName, "Summary", "Subject")

iProperties.Value("Status", "Status") = iProperties.Value(modelName, "Status", "Status")

It can be extended to copy all model iProperties.

 

Please feel free to contact if there is any doubt.

 

If solves problem, click on "Accept as solution" / give a "Kudo".

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network