How do you get the PointIntentEnum from an Assembly Joint?

How do you get the PointIntentEnum from an Assembly Joint?

JoeBarnes4076
Advocate Advocate
689 Views
9 Replies
Message 1 of 10

How do you get the PointIntentEnum from an Assembly Joint?

JoeBarnes4076
Advocate
Advocate

I am trying to make a copy of an assembly joint.  It appears that that the originone.IntentType and origintwo.IntentType do not return a PointIntentEnum which is required to properly recreate the joint.  Is this a bug or is there another way to get the PointIntentEnum?

 

Any help would be appriciated.

 

 

0 Likes
690 Views
9 Replies
Replies (9)
Message 2 of 10

JaneFan
Autodesk
Autodesk

Hi @JoeBarnes4076 , 

 

It should return a value of PointIntentEnum. If it isn't, can I know what kind of value being returned in your side? 

Select any joint from browser model, then run the following code in VBA environment.

Sub test()
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oJoint As AssemblyJoint
Set oJoint = oDoc.SelectSet(1)

Dim oJointC As AssemblyJointDefinition
Set oJointC = oJoint.Definition.Copy()
Debug.Print oJointC.OriginOne.IntentType
End Sub




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 3 of 10

JoeBarnes4076
Advocate
Advocate

58117 for OriginOne

58118 for OriginTwo

Returned_IntentTypeEnum.PNG

0 Likes
Message 4 of 10

JaneFan
Autodesk
Autodesk

I see.

58117 is the value for IntentTypeEnum.kNoPointIntent and 58118 is the value for IntentTypeEnum.kPointIntent. KNoPointIntent is returned in the case of the GeometryIntent being created without Intent specified. If you want to switch the NoPointIntent to PointIntent, here is the way, in which kMidPointIntent can be values like kStartPointIntent, KEndPointIntent or else.

Sub test()
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oJoint As AssemblyJoint
Set oJoint = oDoc.SelectSet(1)

Dim oJointC As AssemblyJointDefinition
Set oJointC = oJoint.Definition.Copy()

oJointC.OriginOne = oDoc.ComponentDefinition.CreateGeometryIntent(oJointC.OriginOne.Geometry, PointIntentEnum.kMidPointIntent)

Debug.Print oJointC.OriginOne.IntentType
End Sub




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 5 of 10

JoeBarnes4076
Advocate
Advocate

One of the main goals is to interrogate the existing Joint so it can be recreated with a new component instance using the previous Point Intent types.

I added the code

 

oJointC.OriginOne = oDoc.ComponentDefinition.CreateGeometryIntent(oJointC.OriginOne.Geometry, PointIntentEnum.kCenterPointIntent)
oJointC.OriginTwo = oDoc.ComponentDefinition.CreateGeometryIntent(oJointC.OriginTwo.Geometry, PointIntentEnum.kPlanarFaceCenterPointIntent)

 

 

Once the new joint is created the PointIntentEnum is lost and reverts to kNoPointIntent and kPointIntent.

 

Joe

 

0 Likes
Message 6 of 10

JaneFan
Autodesk
Autodesk

Hi @JoeBarnes4076 ,

 

I doubt whether it is something related to the geometry type. Is it possible to provide a simple model for reproducing it? 




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 7 of 10

JoeBarnes4076
Advocate
Advocate

Here you go

Joints.iam is the assembly with two components

0 Likes
Message 8 of 10

JaneFan
Autodesk
Autodesk

Hi @JoeBarnes4076 , 

 

I see the thing here. Geometry for IntentOne is Circle Edge, but not circular face or Cylindrical face. In such case, KNoPointIntent is returned for IntentType. But it does no harm on creating the same new joint feature. 

We don't need to switch it to KPointIntent on purpose if we want to create a same new one.

Sub test()
Dim oDoc As AssemblyDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oJoint As AssemblyJoint
Set oJoint = oDoc.SelectSet(1)

Dim oJointC As AssemblyJointDefinition
Set oJointC = oJoint.Definition.Copy()

oJoint.Suppressed = True
Dim oNew As AssemblyJoint
Set oNew = oDoc.ComponentDefinition.Joints.Add(oJointC)

End Sub




Jane Fan
Inventor/Fusion QA Engineer
0 Likes
Message 9 of 10

JoeBarnes4076
Advocate
Advocate

I'm going to give up for now.  Thanks for your help.

0 Likes
Message 10 of 10

JoeBarnes4076
Advocate
Advocate

Ok, So I've tried this several ways and I can create Joints from scratch all day long using PointIntentEnum's in the CreateGeometryIntent method. 

 

After the Joint is created from an AssemblyJointDefinition, it never returns what was used for the original PointIntentEnum's.

Is there some other method to determine what PointIntentEnum was used when the joint was originally created?

Returned_IntentTypeEnum_2.PNG  

0 Likes