ilogic - copy drawing iproperty to model iproperty

ilogic - copy drawing iproperty to model iproperty

Anonymous
Not applicable
1,987 Views
15 Replies
Message 1 of 16

ilogic - copy drawing iproperty to model iproperty

Anonymous
Not applicable

Hello!

 

I currently work in a company that has uses an automatic file numbering system for ipt and iam files. The idw file names are picked from the project's Master document register. In other words, the models get a random number / name, while the idw's are predined. This means that there's NO link what so ever between the model file name and the idw file name. 

 

Now i want to create an ilogic rule that simply copies the idw's file name to a custom iproperty in the model.

I would like to do this, so I can find out (without opening vault) which idw is linked to a specific model.

 

Does anyone know how to do this? 

 

I made this rule, which only works for models with the same name, doesn't it?

 

SyntaxEditor Code Snippet

'copy idw drawing number to ipt custom iproperties'Exit rule If no Part or Assembly Is in the drawing yet
If (ThisDrawing.ModelDocument Is Nothing) Then Return
'get the file name of the doc the drawing points to
modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
'read the values from the iProperties in the part file'then apply to the iProperties with the same name in the drawing file
iProperties.Value(modelName,"Custom", "Drawing Number")=iProperties.Value("Project", "Part Number")

 

PS. I already created to custom iproperty in the model, to avoid any problems there.

 

thank you in advance! 

0 Likes
1,988 Views
15 Replies
Replies (15)
Message 2 of 16

bradeneuropeArthur
Mentor
Mentor

Hi,

 

You better use the Vault API to achieve this.

Because:

  • What If the file is renamed in the vault
  • What If the file is moved in the vault

I can learn you haw to do this without adding any property to the documents......

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 3 of 16

waynehelley
Collaborator
Collaborator

I'm curious (mainly because I have never personally touched the Vault API) as to what you are suggesting here.

 

Is it fairly straight forward to retrieve information from Vault by adding reference to the Vault dll to an iLogic rule or NET addin?  I've always been too scared to try in case I bring a server down.

 

Do you have any examples?

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
0 Likes
Message 4 of 16

bradeneuropeArthur
Mentor
Mentor

Hi,

 

Are you familiar with creating add ins for inventor using VB.net?

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 5 of 16

waynehelley
Collaborator
Collaborator

Yes I am.  What I'm curious about is how easy it is to use the Vault object library and how easy it is to connect to a Vault server.

Wayne Helley
Inventor 2013 Certified Professional

Autodesk Inventor Professional 2023
Visual Studio 2022
Windows 10 Pro, 64-bit
0 Likes
Message 6 of 16

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

I just cross verified that below iLogic code works for different model name and drawing file name. Through Vault API, may be possible to retrieve model name associated with drawing and visa versa.

 

'copy idw drawing number to ipt custom iproperties'Exit rule If no Part or Assembly Is in the drawing yet
If (ThisDrawing.ModelDocument Is Nothing) Then Return
'get the file name of the doc the drawing points to
modelName = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName)
'read the values from the iProperties in the part file'then apply to the iProperties with the same name in the drawing file
iProperties.Value(modelName,"Custom", "Drawing Number")=iProperties.Value("Project", "Part Number")

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 7 of 16

bradeneuropeArthur
Mentor
Mentor

Hi @chandra.shekar.g

 

There are better solutions for this without properties.

Because Vault is used this method is not the best way.

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 8 of 16

chandra.shekar.g
Autodesk Support
Autodesk Support

@bradeneuropeArthur wrote:

Hi @chandra.shekar.g

 

There are better solutions for this without properties.

Because Vault is used this method is not the best way.

 

 


@bradeneuropeArthur,

 

 

Yes! There might be better solutions.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 9 of 16

bradeneuropeArthur
Mentor
Mentor

@chandra.shekar.g

 

Our intention is the same I think.....

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 10 of 16

Anonymous
Not applicable

Hi Bradeneurope,

 

I don't really see the issue regarding the renaming or file moving comment. As long as the rule runs (i.e. every time the drawing gets saved) the new iproperty gets updated.

 

That said, I am interested in your solution (vault API). Do you have some examples or something you can share?

 

L

0 Likes
Message 11 of 16

bradeneuropeArthur
Mentor
Mentor
Yes.

Wil come back soon

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 12 of 16

bradeneuropeArthur
Mentor
Mentor
Hi,

I could try to explain my arguments, but this is not related to the topic I think.

Yes I have example codes.
I use these methods a lot, because of the arguments above.

I am not on my desk right now so the examples will follow soon.

If you could already post an inventor add in as text, I can add my code to it. This is the easiest way I think.

Regards

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 13 of 16

bradeneuropeArthur
Mentor
Mentor

@Anonymous

 

 

 

Are you also familiar with vb.net and Add-ins?

Than please:

If you could already post an inventor add in as text, I can add my code to it. This is the easiest way I think.

 

-------------------------

 

01-24-2018 07:43 PM in reply to: Boijens
Hi,

I could try to explain my arguments, but this is not related to the topic I think.

Yes I have example codes.
I use these methods a lot, because of the arguments above.

I am not on my desk right now so the examples will follow soon.

If you could already post an inventor add in as text, I can add my code to it. This is the easiest way I think.

Regards

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 14 of 16

bradeneuropeArthur
Mentor
Mentor

Hi'

 

I am ready to edit the code for you, but:

 

Are you also familiar with vb.net and Add-ins?
Than please:
If you could already post an inventor add in as text, I can add my code to it. This is the easiest way I think.

 

!!!!!!!

Hi I have read your post again and if you really want to do it like you wrote then my option is not possible:
Now i want to create an ilogic rule that simply copies the idw's file name to a custom iproperty in the model.
I would like to do this, so I can find out (without opening vault) which idw is linked to a specific model.

!!!!!!!

I think my option, Reading it from Vault is still the better way.

 

I am waiting for your respond.

 

 

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 15 of 16

Anonymous
Not applicable

Hi again,

 

Even though I am really interested in it, I am unfortunately not very accustomed to using vb.net.

 

I am well aware I can find out through vault which drawing is attached to a part/assembly. The only thing I am trying to achieve is less mouse clicking. If I'ld have an iproperty showing the drawing number, I wouldn't have go in vault to find out. 

 

Anyway thanks. 

0 Likes
Message 16 of 16

bradeneuropeArthur
Mentor
Mentor

Hi,

 

What do you want to achieve:

For example:

  • A button which will prompt or showing you the related drawing reference in vault (Vault Path's)?
  • A button which will prompt or showing you the related parts and assemblies reference in vault (Vault Path's)?

think this would be the simplest way!!

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes