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: 

Points 3D measure unit seems to be cm

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
lucabortolotti1984
305 Views, 7 Replies

Points 3D measure unit seems to be cm

In these days I'm posting a lot of questions, but I'm learning... Anyway I always try to find previous related questions and I check the documentation.

I'm trying to understand how to draw lines, points and spline in a sketch and I found this example which I "cut" just after line 30. So this is my last line:

 

spline = sketch.sketchCurves.sketchFittedSplines.add(points)

 

 I'm wondering why these points are considered as they were in cm, as the result I get is this one:

lucabortolotti1984_0-1617124332110.png

And the selected point was the second one, this in the code:

 

points.add(adsk.core.Point3D.create(5, 1, 0))

 

Next step I tried was divide by 10, and I got the expected result. I suppose it works in cm, but I didn't find any reference in the documentation.

 

Then I tried to draw the spline in sketches based on different Reference planes; instead of

 

sketch = rootComp.sketches.add(rootComp.xYConstructionPlane)

 

I tried

 

sketch = rootComp.sketches.add(rootComp.xZConstructionPlane)

 

and

 

sketch = rootComp.sketches.add(rootComp.yZConstructionPlane)

 

Ok, in both these case I completely didn't understand the result and I can't figure out how does it work.

Any suggestions?

 

Thanks

Luca

 

 

Labels (1)
7 REPLIES 7
Message 2 of 8

According to Understanding Units in Fusion 360:

 

If you call the SketchCurve.length property to get the length of an entity in a sketch, the value returned will always be in centimeters.

 

The length passed in is always expected to be in database units (centimeters)

Message 3 of 8

That's super useful, thanks!
Do you have any guess for the second part of my post?

Thanks again!
Message 4 of 8

Regarding your second question, each sketch has its own coordinate system.  When you draw sketch geometry, the coordinates are relative to the sketch coordinate system.  If you create a sketch on the XY construction plane, that coordinate of that sketch will align with the world coordinate system.  Sketches created on the other two base construction planes will have their origin at world (0,0,0) but their axes will be oriented differently.  If you create a sketch on the base YZ plane, the X-axis of the sketch is in the world negative Z direction, the Y is in the positive Y direction and the Z is in the positive X direction.  The coordinate system of a sketch created on another construction plane or face can be in any orientation and position.

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

When you use Point3D objects in SketchFittedSplines.add method, the points are considered to be in sketch space (not world space/model space).

 

If you have a Point3D object in model space you can use Sketch.modelToSketchSpace Method to find the equivalent point in sketch space. Similarly if you have a Point3D object in sketch space you can use Sketch.sketchToModelSpace Method to find the equivalent point in model space.

 

Also the sketch orientation may be somehow confusiong. I suggest reading this post by @apocalip, specially @BrianEkins  answer to that post.

Message 6 of 8
nnikbin
in reply to: nnikbin

Sorry, when I posted I did not nitice that @BrianEkins  has answered your question.

Message 7 of 8

Thanks, perfectly to the point, to stay in topic 😉
Message 8 of 8

Thanks for the reply, it is useful also after the great reply of @BrianEkins, because it adds the information about conversion between spaces! I was already thinking about how to apply matrix rotations or switch to quaternions... You saved my day!

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