copy custom model ipropertites to drawing iproperties

copy custom model ipropertites to drawing iproperties

andrew_canfield
Collaborator Collaborator
343 Views
2 Replies
Message 1 of 3

copy custom model ipropertites to drawing iproperties

andrew_canfield
Collaborator
Collaborator

Hello 

A drawing border swap out is need on a set of drawings.

The new border references custom drawing iproperties

the old border refernces custom part iproperties

some of the iproperties have slightly different names.

 

In the past i used:

 

SyntaxEditor Code Snippet

    Dim docFile As Document

    If ThisDoc.ModelDocument IsNot Nothing Then
    docFile = ThisDoc.ModelDocument
    Else

to write from a text box to the custom iproperties of the part - first model placed on the drawing.

 

SyntaxEditor Code Snippet

iProperties.Value(docFName, "Custom", "TITLE_LINE_4") = iProperties.Value("Custom", "TITLE_LINE_4") 
iProperties.Value(docFName, "Custom", "PLANT_TITLE") = iProperties.Value("Custom", "PLANT_TITLE") 

i'm guessing to port the values from the model to the drawing i need to change this:

 

SyntaxEditor Code Snippet

docFile = ThisDoc.ModelDocument

 

for docFile i could copy & rename to dwgFile

ThisDoc.ModelDocument  copy & rename to whatever the drawing is referenced as?

 

then create a mapping to compensate for the slight differences in custom iproperty names.

 

That's the outline of my plan - scouring this site for code to 'borrow' 🙂 

 

0 Likes
344 Views
2 Replies
Replies (2)
Message 2 of 3

JamieVJohnson2
Collaborator
Collaborator

wouldn't you just swap the items from either side of the = signs?

Model property = drawing property:

iProperties.Value(docFName, "Custom", "TITLE_LINE_4") = iProperties.Value("Custom", "TITLE_LINE_4")

drawing property = model property:

iProperties.Value("Custom", "TITLE_LINE_4") =iProperties.Value(docFName, "Custom", "TITLE_LINE_4") 

 

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes
Message 3 of 3

andrew_canfield
Collaborator
Collaborator

Thanks Jamie - you're right.

I didn't really know how iproperties were found by ilogic where some are in a model & some in a drawing.

Anyway it's how you describe it - i posted the question then gave it a go & it's working.

 

Reagrds

 

Andrew

0 Likes