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: 

sketch.move does nothing when a particular instance of sketchLine.trim is called

0 REPLIES 0
Reply
Message 1 of 1
lorraine5RWGT
193 Views, 0 Replies

sketch.move does nothing when a particular instance of sketchLine.trim is called

When I call `sketch.move`, nothing happens if far back in my code, I had called `line.trim`.  Problem disappears (i.e. the specific `sketch.move` works) if I comment out that specific call to `line.trim`.

 

Strange, because problems with `sketch.move` don't seem like they should be related to `line.trim`

 

line = sketch.sketchCurves.sketchLines.addByTwoPoints(p1, p2)
# (Added CoincidentConstraint and PerpendicularConstraint)
line.trim(line.endSketchPoint.geometry, True)

# Later on, in another file
returnValue = sketch.move(sketchEntities, transform)

This last `sketch.move` command only moved the sketch if the `line.trim` above was commented out, despite it always returning True.  Both instances of `sketch` refer to the same sketch in the code snippet above.

 

`sketchEntities` is an ObjectCollection of multiple SketchPoint.  This collection of points what all the processing is based on, meaning `line` is just one of many sketch entities that were computed from other lines that were computed from the points, etc.

 

This behaviour is consistent for the same data across Fusion restarts. (e.g. it consistently happens for specific sets of data, but consistently doesn't happen on other sets of data)

Tags (4)
0 REPLIES 0

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