Compare components - Mass Properties check - what is Task Scheduler checking

Compare components - Mass Properties check - what is Task Scheduler checking

tmuel
Advocate Advocate
537 Views
4 Replies
Message 1 of 5

Compare components - Mass Properties check - what is Task Scheduler checking

tmuel
Advocate
Advocate

Hello,

 

Simple question:

What method is the task scheduler using when it passes or fails a file during migration with a "Mass Properties check error"?

 

What I am trying to accomplish:

I would like to use a similar method - or perhaps someone could propose a better one, to test if file X is the same physical part as file Y. I do not care about differences in properties stored in the file, I want to test physical geometry only.

 

More info:

A company I'm working with creates custom machines. They use a project based methodology and skeletal modeling where each machine and its components reside in a project folder. Part numbers are unique to each machine. This makes part reuse across projects very difficult/limiting. Many of these machines are copied from a previous similar job using Vault Copy Design. In a high volume mfg operation, these components would be reused, but they need to be unique for this situation, even if they are actually identical (which is often the case, and the issue I am trying to streamline).

 

The nesting, routing and operation information is input and stored in our ERP system for each brand new file and a "library part file" is stored in our nesting and our forming software with any lead-inns or adjustments that the operator made during mfg. When we do a copy design in Vault, the original file name is pushed into a ref field in the new files. So, I want to test a copied part against its reference (original) part. If it is physically the same part (with different property info - and the referenceDesignator may or may not match), copy the ERP info, routings etc, (burn/punch/form) and by-pass any manual entry. Or else, treat it as a new file.

 

Any suggestions would be welcomed.

 

Tim

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

frederic.vandenplas
Collaborator
Collaborator

hi @tmuel i think comparing the mass properties is the best you can do as far that i fully understand your question.

The chances are nihil that a differently designed part is exactly the same as the one you compare with.

You can go as far as you want with the compare.
From other projects i do remind that i needed to round the values because if it's a little bit off (0,0000001) you wont detect a similar part

'Create a part and save a copy
'just 2 documents should be open for this test

Sub CompareProperties()

Dim oDoc1, oDoc2 As PartDocument
Set oDoc1 = ThisApplication.Documents(1)
Set oDoc2 = ThisApplication.Documents(1)

Dim oCompDef1, oCompDef2 As PartComponentDefinition
Set oCompDef1 = oDoc1.ComponentDefinition
Set oCompDef2 = oDoc2.ComponentDefinition

If oCompDef1.MassProperties.Volume = oCompDef2.MassProperties.Volume Then
If oCompDef1.MassProperties.Mass = oCompDef2.MassProperties.Mass Then
If oCompDef1.MassProperties.Area = oCompDef2.MassProperties.Area Then
If oCompDef1.MassProperties.CenterOfMass.x = oCompDef2.MassProperties.CenterOfMass.x Then
    Debug.Print "Chances are good that part is exactly the same"
End If
End If
End If
End If

End Sub
If you think this answer fullfilled your needs, improved your knowledge or leads to a solution,
please feel free to "kudos"
Message 3 of 5

tdant
Collaborator
Collaborator

I know that when you run "Save Copy As" on a document, the resulting copy has the same Document.InternalName as the original. This is not only faster, but also more reliable. If all the test files have one common ancestor file, they should all have the same InternalName, provided that Copy Design works the same as Save Copy As.

 

Edit: I tested a Copy Design on one part, and the resulting files share the same InternalName. I think this method will work for your problem.

Message 4 of 5

BrianEkins
Mentor
Mentor

There are varying levels you can go to verify if one part is geometrically the same as another.  The simplest, as already shown is it check the volume and center of mass.  However, you can easily concoct cases where this will return that they're equal when they're obviously not.  For example, I can have a cube and a sphere that are centered on the same location and have the same volume and will report as being equal.  The next step is to start looking at the actual geometry of the parts.  For example, you can check that each part has the same number of faces, edges, and vertices.  The next step would be to compare the actual geometry of each.  Each additional check means writing more code and it will also take a bit longer to do the comparison but it means ensuring the parts are truly the same.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
Message 5 of 5

tmuel
Advocate
Advocate

Thanks to all for the quick replies. With your help, I am getting closer to a solution.

 

I did consider checking the mass properties and the internal name from the parent part. Where I am struggling is because of the way the components are often derived, sharing the origin of the master sketch to define their position in the assembly. The entire assembly including the master sketch is copied and likely modified. So, the Center of Mass of two otherwise identical components may differ in relation to the origin of the old/new master sketch. This is the reason we often avoid reuse of an identical component if there is any possibility that its size or position may vary downstream based on customer changes.

 

Because the Center of Mass of the new component will often vary in comparison to the Origin of the original, I ignore that check but can use the others that Frederic suggested. Thank you, that was helpful! Since these are all sheet metal parts, I plan to test flat pattern extents and sheet metal style as well. I found that if I compare the Inertial Properties with respect to the CG it will identify changes that do not affect mass, volume or area - like a hole position change. It also seems to do a nice job of identifying left vs right formed parts (if they are not at an odd angle).

 

"oMassProps1.XYZMomentsOfInertia(Ixx, Iyy, Izz, Ixy, Iyz, Ixz)"

 

The flaw in this test is the case where the position of a part body (in a part) varies in rotation (see image). I think that this would be a rare case for us, and may just have to accept it as a known flaw.

InertialProps - rotation.png

 

Thank you all for the helpful suggestions. If you see any other flaws that I am missing, or other suggestions, I would appreciate any input.

Regards,

Tim

 

0 Likes