Add iProperties "part number" in part sketch text.

Add iProperties "part number" in part sketch text.

timdown73
Collaborator Collaborator
2,565 Views
5 Replies
Message 1 of 6

Add iProperties "part number" in part sketch text.

timdown73
Collaborator
Collaborator

I have a sketch with text on my part. I am manually typing in the part numbers in the sketch of each part so that I can see the part numbers while I'm working on the model. Is there a way to get the part number from the iProperties of the part/assembly to populate the text in the sketch? As it stands now, it seems like I can only bring parameters into the sketch text but not iProperties.

-Tim U.
Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz 2.30 GHz>Memory: 32.0 GB Ram
Op Sys: Windows 10 professional
0 Likes
Accepted solutions (1)
2,566 Views
5 Replies
Replies (5)
Message 2 of 6

CGBenner
Community Manager
Community Manager

@timdown73 

 

From what I am seeing, I'd hav to say there is no way to add iProperties to the text editor in sketches.  This might be one for the Ideas Forum.  I can see where it might be useful.

 

Or... there may be a way programatically to create a user parameter that takes the value of the Part Number?  Then you could use the parameter in your text.  Anyone have any ideas on that?

Did you find a post helpful? Then feel free to give likes to these posts!
Did your question get successfully answered? Then just click on the 'Accept solution' button.  Thanks and Enjoy!



Chris Benner

Community Manager - NAMER / D&M


Message 3 of 6

Gabriel_Watson
Mentor
Mentor
Accepted solution

Combine these two snippets found here:
https://www.cadforum.cz/en/how-to-create-custom-iproperty-or-parameter-with-ilogic-tip12024

 

Galaxybane_1-1645195058676.png


To create a User Parameter made with the value found in the iProperty. Then insert the User Parameter in your text. You'll just need to get the iProp value like this below, and set some trigger (or manual) to run the iLogic:

"iProperties.Value("Custom", propertyName) = propertyValue"

 

Galaxybane_0-1645195037130.png

 

Message 4 of 6

timdown73
Collaborator
Collaborator

Thanks!

I wish there was a way to do this without iLogic.

-Tim U.
Intel(R) Core(TM) i7-10875H CPU @ 2.30GHz 2.30 GHz>Memory: 32.0 GB Ram
Op Sys: Windows 10 professional
Message 5 of 6

Gabriel_Watson
Mentor
Mentor
Message 6 of 6

darseygodwin
Observer
Observer

I didn't fully understand the above solution so maybe this is the same thing, but dabbling a bit here's what I did, and it's working well for me:

1. Create a Text User Parameter in the Part (not iProperties) called "PartNumber"

2. Create a Rule or External Rule depending if it should only be in the Part file or if you plan on doing this across all parts using an updated template. I called my rule "Update PartNumber"

3. This is my rule:

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

(Notice, space in the iProperties value, but no space in the part's User Parameter value)

4. Create Event Trigger, triggering the rule to run when iProperty values are changed.

5. You can now use the User Parameter in text boxes. You also need to hit Refresh for the change to take effect on the text.

 

Also, I actually did this with a second line for "Revision = Revision Number", but didn't want to complicate the explanation.

Cheers.