Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

identity matrix - causing problems

2 REPLIES 2
Reply
Message 1 of 3
MichaelT_123
305 Views, 2 Replies

identity matrix - causing problems

Hi WhomInTheKnow,

 

I have spent quite few hours trying to debug some dynamic code. I would have never considered that identity matrix will show malicious behaviour, but it did!

It turns that moveFeature can not accept identity matrix as an argument.

It is hard to believe, isn't it?

Please check it yourself by running moveFeature sample script while commenting one line (red marker):

 

        # Create a transform to do move
        vector = adsk.core.Vector3D.create(0.0, 10.0, 0.0)
        transform = adsk.core.Matrix3D.create()
        #transform.translation = vector
 

The error is symptomatically cryptic:

 

    moveFeats.add(moveFeatureInput)
  File "C:/Users/MichaelT/AppData/Local/Autodesk/webdeploy/production/20eba7b8590bd15aa5cf30169381ceca41f2dc77/Api/Python/packages\adsk\fusion.py", line 18803, in add
    return _fusion.MoveFeatures_add(self, *args)
RuntimeError: 3 : invalid transform

 

Sincerely

MichaelT

 

 

 

 

MichaelT
2 REPLIES 2
Message 2 of 3
kandennti
in reply to: MichaelT_123

Hi MichaelT_123.

 

I tried changing this sample.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-153E540B-6246-460C-8B6A-4C58165CEBAA 

 

Certainly an error occurred.
Since there is no point in converting with the identity matrix,
It seems necessary to check in advance.

・・・
        # Create a transform to do move
        vector = adsk.core.Vector3D.create(0.0, 10.0, 0.0)
        transform = adsk.core.Matrix3D.create()
        #transform.translation = vector

        if transform.isEqualTo(adsk.core.Matrix3D.create()):
            return

        # Create a move feature
        moveFeats = features.moveFeatures
・・・

In the conversion that does nothing even manually, the OK button was gray and could not be pressed.

Message 3 of 3
MichaelT_123
in reply to: kandennti

Hi Kondennti-san,

 

Thank you for checking,... it means that it is not the fatamorgana.

Identity matrix is the foundation of ALGEBRA as we know it. Also Identity has the special and well understood meanings in many other fields. 

Disallowing or disobeying its properties in any system and particularly in geometrical one is a NONSENSE.

 

With Regards

MichaelT    

 

MichaelT

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report