iLogic to Change Browser Name of Part to Part Number

iLogic to Change Browser Name of Part to Part Number

felix.cortes5K3Y2
Advocate Advocate
426 Views
3 Replies
Message 1 of 4

iLogic to Change Browser Name of Part to Part Number

felix.cortes5K3Y2
Advocate
Advocate

Hi Forum,

 

I want to add a part using the following command provided by inventor:

 

Dim componentA = Components.AddContentCenterPart("occNameA", "Fasteners:Bolts:Hex Head", "AS 1427 - Metric",
                                                 "M3 x 16", position := Nothing, grounded := False, 
                                                 visible := True, appearance := Nothing)

However, I'd like to change the browser name to the Part Number given in the description. I've read through the post named: Using iLogic to Rename Browser Nodes. However, that post renames all of the browser items and I wouldn't want to do that.

 

How can I name the component on the browser to it's correct Part Number?

 

Best regards,

Felix

0 Likes
427 Views
3 Replies
Replies (3)
Message 2 of 4

HermJan.Otterman
Advisor
Advisor

did you try:

 ComponentA.name = "partnumber_1"   ..??

(the name must be unique!)

If this answers your question then please select "Accept as Solution"
Kudo's are also appreciated Smiley Wink

Succes on your project, and have a nice day

Herm Jan


0 Likes
Message 3 of 4

felix.cortes5K3Y2
Advocate
Advocate

That didn't seem to work since the name is Read Only. I can retrieve the part number by:

 

Dim PartNumber As String = iProperties.Value("occNameA", "Project", "Part Number")

How can I set the browser name to the PartNumber?

 

Best regards,

Felix

 

0 Likes
Message 4 of 4

JaneFan
Autodesk
Autodesk

Hey @felix.cortes5K3Y2 , 

 

It seems like renaming occurrence name to part number can meed your needs: 

componentA.Occurrence.Name = iProperties.Value("occNameA", "Project", "Part Number")

 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes