Chamfer isFlipped parameter gives

Chamfer isFlipped parameter gives

akash102YP2U
Observer Observer
609 Views
6 Replies
Message 1 of 7

Chamfer isFlipped parameter gives

akash102YP2U
Observer
Observer

I am trying to analyze my chamfers and want to access the .isFlipped attribute as follows:  flip_sides = edge_set.isFlipped.

 

However, i continually get an InternalValidationError : res.

 

Here is my trying to investigate:

Screenshot 2024-10-24 at 2.59.22 PM.png

 However, that outputs the following:

distanceOne: <adsk.fusion.ModelParameter; proxy of <Swig Object of type 'adsk::core::Ptr<adsk::fusion::ModelParameter > *' at 0x2dd29d560> >

distanceTwo: <adsk.fusion.ModelParameter; proxy of <Swig Object of type 'adsk::core::Ptr<adsk::fusion::ModelParameter > *' at 0x2dd29dce0> >

edges: <adsk.core.ObjectCollection; proxy of <Swig Object of type 'adsk::core::Ptr< adsk::core::ObjectCollection > *' at 0x2dd29d920> >

isFlipped: Unable to retrieve value

isTangentChain: True

isValid: True

objectType: adsk::fusion::TwoDistancesChamferEdgeSet

this: <Swig Object of type 'adsk::core::Ptr< adsk::fusion::TwoDistancesChamferEdgeSet > *' at 0x2dd29d8c0>

thisown: True

Error accessing isFlipped: <lambda>() takes 1 positional argument but 2 were given

Error: 2 : InternalValidationError : res

 

Any help on solving this would be amazing!

0 Likes
610 Views
6 Replies
Replies (6)
Message 2 of 7

Jorge_Jaramillo
Collaborator
Collaborator

Hi,

 

I believe your problem in the code snippet you sent is what you have in the try-except block (I don't understand what are you trying to do on it starting with the cast; you are passing a class, but cast works over an object instead over a class).

 

The last sentence (flip_sides = edge_set.isFlipped) should work. Since edge_set object is an instance of adsk.fusion.TwoDistancesChamferEdgeSet class, edge_set.isFlipped is enough to get its property value.

Can you test your code commenting out all the try-except block? 

 

Please note that the error message "InternalValidationError " is coming from the lambda function inside the try-except block.

 

Regards,

Jorge Jaramillo

 

0 Likes
Message 3 of 7

akash102YP2U
Observer
Observer

I initially tried it without that code (as below) and got the same internal validation error: res.

Screenshot 2024-10-24 at 3.52.59 PM.png

 

0 Likes
Message 4 of 7

Jorge_Jaramillo
Collaborator
Collaborator
Can you sent your code as text to try it over here?
With an image it is hard since I have to rewrite it.
Message 5 of 7

Jorge_Jaramillo
Collaborator
Collaborator

Hi,

 

I was able to reproduce your error in my environment.

I created two chamfers to a body of type TwoDistances and DistanceAndAngle, and from the text command made an inspection with the following results:

 

app.activeProduct.rootComponent.features.chamferFeatures.item(0).edgeSets.item(0)
<adsk.fusion.TwoDistancesChamferEdgeSet; proxy of <Swig Object of type 'adsk::core::Ptr< adsk::fusion::TwoDistancesChamferEdgeSet > *' at 0x00000161CEB4E970> >

 

app.activeProduct.rootComponent.features.chamferFeatures.item(0).edgeSets.item(0).isFlipped
Traceback (most recent call last):
File "<string>", line 1, in <module>
return _fusion.TwoDistancesChamferEdgeSet__get_isFlipped(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 2 : InternalValidationError : res

 

app.activeProduct.rootComponent.features.chamferFeatures.item(1).edgeSets.item(0)
<adsk.fusion.DistanceAndAngleChamferEdgeSet; proxy of <Swig Object of type 'adsk::core::Ptr< adsk::fusion::DistanceAndAngleChamferEdgeSet > *' at 0x00000161CD29A700> >

 

app.activeProduct.rootComponent.features.chamferFeatures.item(1).edgeSets.item(0).isFlipped
Traceback (most recent call last):
File "<string>", line 1, in <module>
return _fusion.DistanceAndAngleChamferEdgeSet__get_isFlipped(self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: 2 : InternalValidationError : res

 

I got the same error you get in both types of chamfers.

I looks like a BUG in the Fusion API.  I hope someone from @autodesk can take a look at it.

 

Regards,

Jorge Jaramillo

 

Message 6 of 7

akash102YP2U
Observer
Observer

Thanks for checking it out. Hopefully autodesk will take a look soon

0 Likes
Message 7 of 7

KrisKaplan
Autodesk
Autodesk

Hi,

 

Yes. I can confirm that this indeed a defect in the isFlipped property implementation for TwoDistancesChamferEdgeSet and DistanceAndAngleChamferEdgeSet. I filed an issue for this.

 

These implementations are improperly validating the result ("res") variable, and will incorrectly treat the 'not isFlipped' state as an error and raise this validation error. So an ugly workaround until the fix for this is available would be to just catch and ignore this "res" internal validation error for this specific property and treat it as a `false` result.

 

Kris



Kris Kaplan