Modifying screws in nested assemblies

Modifying screws in nested assemblies

mc_inventor
Participant Participant
657 Views
3 Replies
Message 1 of 4

Modifying screws in nested assemblies

mc_inventor
Participant
Participant

Hi all,

 

I am working on a large assembly composed of multiple subassemblies, which in turn are composed of multiple sub-assemblies.

 

The parts I'm working with are STEP-files. There are about 150 different screws used in the assembly.

 

The subassemblies will have part lists included when sent to production, so I need to change either the screws or the part numbers of these screws in these assemblies so that the part numbers line up with the ones in our inventory. The same goes for the Bill Of Materials that needs to be generated.

 

The screws that need to be replaced also have a slight visual difference. I will just try my best to ignore this as long as possible.

mc_inventor_1-1647333686251.png

 

All the screws are 90 degrees tilted when compared to our local parts, so replace all requires the extra step of making a local version that is then manually rotated 90 degrees around the Y-axis.

mc_inventor_2-1647334403221.png

Furthermore: replace all doesn't replace any of the parts in the sub-assemblies.

 

The most feasible method I can think of would be to change the source files to match our local part numbers.

 

Is there a way to change a large quantity of part's part numbers by using a hard-coded lookup table?

Is it also possible to track these changed parts and make them invisible in the main assembly after they have successfully changed?

Preferably I would also change the material on all these screws. Alternatively I would like to be able to look up all the materials in the whole assembly and change every occurrence of this specific material.

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

A.Acheson
Mentor
Mentor

That sounds like a lot of work for sure. The iproperty change would likely be the easiest but replacing the physical part might be more difficult. 

 

iProperties of the fasteners can be retrieved from the BOM/ document reference if you can identify them all. Is there a common letters in there descriptions  name/occurrence name /category across them all? If so you can filter for this and extract the iproperties to excel. And then reimport them back in. It may or may not be as quick as manually doing it, this will depend on how clean your search criteria is to begin with. 

 

Replacing all the parts is doable but how successfully the constrain solve is will depend on what geometry was used when  constraining.

 

If you think you can replace the part, post your code attempt and we can go from there. Are you replacing with content center or a library part? 

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 4

mc_inventor
Participant
Participant

Thank you for the reply.

The search criteria are pretty clean. I have compiled a list of all the part names, and their corresponding replacement names. This can easily be applied to an excel list if I can get that.

All the screws start with the same character sequence, so that would enable me to exclude a lot of parts already.

Exporting and importing back would definitely be my preferred method.

I have tried using the Refactoring tool, but it gave me the error :"some files need migrating"

After clicking migrate docs, there are lots of files with a "Migration failed" error.

 

Do you know of any other method of exporting and importing iproperties?

 

Some boundary conditions have changed a bit:

I need to create 2D-drawings of all individual subassemblies, with 4 views each.

Each of these drawings will need a content list (with the updated part numbers)

 

My current pseudocode looks like this:

 

create CSV

list1=[a,b,c,d,e,f]
list2=[a2,b2,c2,d2,e2,f2]

for every assembly
    for every part
		i=0
        for every item on list1
			i++
			if list1(i)==part number
				part number=list2(i)
				append csv with assembly name,list1(i),list2(i)
	create drawing according to template A (making sure the drawings and the list fit on the drawing)

 

Would this method be viable?

0 Likes
Message 4 of 4

A.Acheson
Mentor
Mentor

For the iproperties I would use All Referenced Documents This targets only the single file even if used in multiple sub assemblies so is the shortest route to target each documents. Then next is to filter for parts only and then actually retrieve the iproperties. Once you have the value use go excel snippets(not Included below) to capture the data. You will need to capture the filename also in order to use that as the unique reference to reimport the data. 

 

Dim oAssyDoc As AssemblyDocument
  oAssyDoc =ThisApplication.ActiveDocument 
  

	'Get all of the referenced documents.
    Dim oRefDocs As DocumentsEnumerator
    oRefDocs = oAssyDoc.ReferencedDocuments

    'Iterate through the list of documents.
    Dim oRefDoc As Document
    For Each oRefDoc In oRefDocs
		 If oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
			Logger.Info("DisplayName: "& oRefDoc.DisplayName)'FileName
			Logger.Info("FullDocumentName: "& oRefDoc.FullDocumentName)'FilePath
			Logger.Info("FullFileName: "& oRefDoc.FullFileName)'FilePath
' Get the Design Tracking property set.
  Dim designTrackPropSet As PropertySet
designTrackPropSet = oRefDoc.PropertySets.Item("Design Tracking Properties")

' Get the Description property.
    Dim PartProp As Inventor.Property
  PartProp = designTrackPropSet.Item("Part Number")

Logger.Info(PartProp.Value) End If Next

 

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