Community
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Allow Constraints to be applied to C.O.G. (Center of gravity) in an Assembly

Allow Constraints to be applied to C.O.G. (Center of gravity) in an Assembly

We often design lifting equipment, and the need to know how a piece of equipment will hang from a lift point is very important.

 

Currently is we want to show a piece of equipment hanging properly, we need to constrain to a user made workpoint or axis, and redefine this geometry as the equipment design changes.

 

It would be a real benefit if we could instead have the shackle aligned with the COG as it would in real life.

 

It would also help, if we could then set the view in the drawing to use that aligning workplane to adjust the view rotation so the lift point is always above the COG.

 

Use COG.png

1 Comment
DRoam
Mentor

I agree with you that this would be useful.

 

In the meantime, the following iLogic code from @jletcher (originally posted here) will create a workpoint called "Center of Mass" and place it at the current CoG.

 

It works great for parts, but it does not update per changes to an assembly. If your assembly changes, you'll have to delete the point and run the code to re-create it, then re-associate anything that was constrained to your workpoint.

 

For a part, you can add the rule to the "Before Save Document" event trigger and be confident that your CoG will be up to date after a save.

 

Here's the code:

 

Dim openDoc As Document
openDoc = ThisDoc.Document
Dim docFile As Document
oDoc = ThisApplication.ActiveDocument

Dim oCenterOfMass As Point
    oCenterOfMass = oDoc.ComponentDefinition.MassProperties.CenterOfMass

' Check to see if a work point for center of mass already exists.
' This uses the name of the work feature to identify it.
On Error Resume Next
Dim oWorkPoint As WorkPoint
oWorkPoint = oDoc.ComponentDefinition.WorkPoints.Item("Center Of Mass")

If Err.Number = 0 Then
    Dim oFixedDef As FixedWorkPointDef
    oFixedDef = oWorkPoint.Definition

    oFixedDef.Point = oCenterOfMass
    oDoc.Update
Else
    ' Create a new workpoint at the location of the center of mass.
    oWorkPoint = oDoc.ComponentDefinition.WorkPoints.AddFixed(oCenterOfMass)

    ' Rename the work point.
    oWorkPoint.Name = "Center Of Mass"
End If

Can't find what you're looking for? Ask the community or share your knowledge.

Submit Idea  

Autodesk Design & Make Report