Filename into custom iproperty

Filename into custom iproperty

r.munozMT3QP
Contributor Contributor
2,681 Views
4 Replies
Message 1 of 5

Filename into custom iproperty

r.munozMT3QP
Contributor
Contributor

Hello

I´m ussing Tube and Pipe assembly and i need to add a tags to all the valves, by now the way we do this is to add a custom iproperty called "TAG", publish to CC, save as custom part (pasting the P&iD tag as name, and pasting the P&iD tag again in custom iproperty "TAG".

 

We do this to extract the "TAG" property to our drawings for manufacture

 

What i´m looking for is a way to extract the Filename property and put it into my TAG property automatically, i could use Ilogic, but i have no idea how to use it, so any imput will be appreciated.

 

Many thanks

 

Rodrigo

Accepted solutions (1)
2,682 Views
4 Replies
Replies (4)
Message 2 of 5

mcgyvr
Consultant
Consultant
Accepted solution

Most basic explanation is as follows.. (devil is in the details not yet described by you Smiley Wink )

 

In a part file that has been saved already... Open the ilogic browser (View...User Interface... Ilogic... or use the + next to the model browser to open it)

On the rules tab right click and select "Add Rule"..

Give it a name..

Paste this there and press save and run.. Then close..

An custom iprop with the name TAG and value of your filename should have been created..

'create a custom iprop called TAG and make its value the filename
iProperties.Value("Custom", "TAG") = ThisDoc.FileName(False) 'false = without extension

 



-------------------------------------------------------------------------------------------
Inventor 2023 - Dell Precision 5570

Did you find this reply helpful ? If so please use the Accept Solution button below.
Maybe buy me a beer through Venmo @mcgyvr1269
Message 3 of 5

r.munozMT3QP
Contributor
Contributor

@mcgyvr wrote:

Most basic explanation is as follows.. (devil is in the details not yet described by you Smiley Wink )

 

In a part file that has been saved already... Open the ilogic browser (View...User Interface... Ilogic... or use the + next to the model browser to open it)

On the rules tab right click and select "Add Rule"..

Give it a name..

Paste this there and press save and run.. Then close..

An custom iprop with the name TAG and value of your filename should have been created..

'create a custom iprop called TAG and make its value the filename
iProperties.Value("Custom", "TAG") = ThisDoc.FileName(False) 'false = without extension

 



Many thanks, it works perfect 😄

 

Its possible to make this work with the parts that are inside an a assembly?

 

becouse i have to make this in a valve block with around 100 valves LOL.

0 Likes
Message 4 of 5

cshunt
Enthusiast
Enthusiast

You can write code to cycle through each part of an assembly but if you plan on just doing it once and adding it to the template file for new parts,

You can open the assembly, "click bill of materials" click add "customer iproperty column".

Use the drop down to add the "tag" column.

Add the part name column and copy paste the part name to the tag column... all parts with it pasted in get the "tag" iproperty added.

 

0 Likes
Message 5 of 5

r.munozMT3QP
Contributor
Contributor

@cshunt wrote:

You can write code to cycle through each part of an assembly but if you plan on just doing it once and adding it to the template file for new parts,

You can open the assembly, "click bill of materials" click add "customer iproperty column".

Use the drop down to add the "tag" column.

Add the part name column and copy paste the part name to the tag column... all parts with it pasted in get the "tag" iproperty added.

 


I think that the solution that you propose is similar to how we do it by now (correct me if im wrong, my english could be better XD, so maybe i missunderstood you)

 

Now manually copiying the TAG from the P&ID and pasting into the custom part name and filling the custom TAG iproperty that we have now, if i take the name from the filename as you suggest i will take the *.ipt extension too.

 

I think that the best way to make this is an assembly variation of the solution that mcgyvr gave me.

 

0 Likes