Sketch Orientation
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hey!
I'm quite confused here about the Sketch Orientations.
I'm building an AddIn to create Parametric BayonetLocks and have serious Problems creating the Sketches.
The main issue i have is, that the "orientation" of the sketches i create seems, kinda confusing or "random".
Take this Code for example where i create a Sketch on the root y/z Construction Plane and add lines that show the x/y/z directions:
app = adsk.core.Application.get()
ui = app.userInterface
design = adsk.fusion.Design.cast(app.activeProduct)
root = design.rootComponent
sketch = root.sketches.add(root.yZConstructionPlane)
length = 3
lines = sketch.sketchCurves.sketchLines
lines.addByTwoPoints(adsk.core.Point3D.create(0,0,0), adsk.core.Point3D.create(length,0,0))
lines.addByTwoPoints(adsk.core.Point3D.create(0,0,0), adsk.core.Point3D.create(0,length,0))
lines.addByTwoPoints(adsk.core.Point3D.create(0,0,0), adsk.core.Point3D.create(0,0,length))
This Results in a Sketch that looks like this:
The Problem is, that i want/need to "flip" the "z" axis. So the Line that currently goes down needs to go up.
But i'm seriously lost on how to achieve this. I've already spent ~4-5h trying to google, read and reread the API Documentation and tried Various ways like creating my own 3Point ConstructionPlane, trying to modify the sketch.xDirection/sketch.yDirection, tried to fiddle around with the sketch.origin/sketch.originPoint.geometry, etc.
But nothing i try gives me a sketch that i can work with the "z" direction going up.
If you ask yourself why i need this, i'm trying to code this AddIn properly parametrically and so i need to work with sketchDimensions, which sadly by Design *can not* be negative, so i can't simply move my sketch contents "up" by using negative dimensions.
I hope someone here might now a way to get this working, i'd love to build some AddIns, with parametrics build in but i'm kinda stuck on this issue right now...