update the part number for all the parts in a assembly

update the part number for all the parts in a assembly

joris81194
Observer Observer
304 Views
4 Replies
Message 1 of 5

update the part number for all the parts in a assembly

joris81194
Observer
Observer

Hello,

 

I copied a project with the use of ilogic design copy. That worked great. The new project now has the correct name.

Only when i look at the iproperties the part number is stil the same as the old project. And that number wil be displayed on the drawing. Is it posible to update all the part numbers for a assembly at ones?

 

Greetings Joris

0 Likes
305 Views
4 Replies
Replies (4)
Message 2 of 5

A.Acheson
Mentor
Mentor

Hi @joris81194 

Yes this will be possible. You would need to set up a comparison list maybe in excel and then loop through reference documents and properties accordingly. Have you examples of how the part numbers are changing? Here is an example of change all iproperties to that of the top assembly. Test in a sample assembly ...

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 3 of 5

joris81194
Observer
Observer

hi @A.Acheson,

 

If i use the code you send. The part number changes to the filename of the master assembly.

I want to change the partnumber to the filename of the part or of the subassembly.

 

 

0 Likes
Message 4 of 5

joris81194
Observer
Observer

as you can see, the file name and the part number are different. and i wan the filename and the part numbers to match

0 Likes
Message 5 of 5

A.Acheson
Mentor
Mentor

Hi @joris81194 

 

You can pick up the filename using the System.IO.Path class see Microsoft help here.

 

 

Dim fileNameWOExt As String = IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName)

 

 

In addition you will likely encounter errors if you have content center read only documents in the assembly and if you try to change those part numbers you will run into errors. So here is how to filter only Modifiable documents using document is Modifiable method

 

Syntax

Document.IsModifiable() As Boolean

 

If oDoc.IsModifiable Then
 ' Insert your iproperty code here.
End If

 

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes