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: 

Link Partial text

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
madstrolle
225 Views, 3 Replies

Link Partial text

Hi,

Is there a way to link some of the iProperty text to another iProperty text. Eg. end of Partnumber, to end of Description?

If I Copy a part, the Partnumber changes, but I also want the description to change to the same.

Thanks in advance 

madstrolle_0-1689102781867.png

madstrolle_1-1689102847643.png

 

3 REPLIES 3
Message 2 of 4
JelteDeJong
in reply to: madstrolle

You could try something like this: If you run this rule it will find the part after the _ and add/exchange it with the part after the _ in the description.

Dim partnumber As String = iProperties.Value("Project", "Part Number")
Dim parts = partnumber.Split("_")
Dim lastPart = parts(parts.Count() -1)

Dim oldDescription As String = iProperties.Value("Project", "Description")
Dim descriptionParts = oldDescription.Split("_")
Dim descriptionFirstPart = descriptionParts(0)

Dim newDescription = String.Format("{0}_{1}",descriptionFirstPart,lastPart) 
iProperties.Value("Project", "Description") = newDescription

You could run this rule on save or something like that.

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 4
madstrolle
in reply to: JelteDeJong

Thank you,

It works perfectly.

You made my day 😊

Message 4 of 4
madstrolle
in reply to: JelteDeJong

@JelteDeJong 

I only have one small issue.

I have trickered it to run after save.

When I save an assembly it puts "_" after all files. 

Is it possible to change the code, so if there's no "_" after the file, it should be left as it is?

 

Again thank you 😊

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

Post to forums  

Technology Administrators


Autodesk Design & Make Report