Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.
First time visiting? Here are some places to start:- Looking for a certain topic? Check out the categories filter or use Search (upper right).
- Need support? Ask a question to our Community Support category.
- Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
- Be respectful, on topic and if you see a problem, Flag it.
If you would like to contact our Community Manager personally, feel free to send a private message or an email.
Using FS can we create a sketch on a face of a part or only on Planes?
owen_sparks
Member, Developers Posts: 2,660 PRO
Hi Folks.
I'm playing with my first FS.
Using FS can we create a sketch on a face of a part or only on Planes?
More broadly I have an input of a single vertex (from a sketch on the surface of a solid part). I wish to create a sketch here then add some geometry to work with.
What's the easiest way to accomplish this please? (The Slot Tutorial has us creating new planes but from a coordinate system and a line. I just have a point to start with.)
Many thanks for your help,
Owen S.
I'm playing with my first FS.
Using FS can we create a sketch on a face of a part or only on Planes?
More broadly I have an input of a single vertex (from a sketch on the surface of a solid part). I wish to create a sketch here then add some geometry to work with.
What's the easiest way to accomplish this please? (The Slot Tutorial has us creating new planes but from a coordinate system and a line. I just have a point to start with.)
Many thanks for your help,
Owen S.
Business Systems and Configuration Controller
HWM-Water Ltd
HWM-Water Ltd
Tagged:
0
Best Answers
-
cody_armstrong Moderator, Onshape Employees, Developers, csevp Posts: 215@owen_sparks you can use the sketch plane that the point is on with evOwnerSketchPlane5
-
ilya_baran Onshape Employees, Developers, HDM Posts: 1,210Two things I can see: you need to use newSketchOnPlane instead of newSketch (the former takes a plane, the latter takes a query for a planar face) and you need to pass context into evOwnerSketchPlane as evOwnerSketchPlane(context, definition.targetpoint).
Actually, the third thing is that you should filter the targetpoint to only allow sketch entity selections:
annotation { "Name" : "Select Sketch Point(s)", "Filter" : EntityType.VERTEX && SketchObject.YES }
Hope this helps.Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc5 -
NeilCooke Moderator, Onshape Employees Posts: 5,671Use newSketchOnPlaneSenior Director, Technical Services, EMEAI5
Answers
Sorry to be a PITA but would you mind helping with the syntax?
I have this in the precondition:-
// Target Point(s)
annotation { "Name" : "Select Sketch Point(s)", "Filter" : EntityType.VERTEX, "MaxNumberOfPicks" : 1 }
// or for unlimited picks
// annotation { "Name" : "Select Sketch Point(s)", "Filter" : EntityType.VERTEX }
definition.targetpoint is Query;
...and then later in the function:-
var sketch2 = newSketch(context, id, {
"sketchPlane" : evOwnerSketchPlane(definition.targetpoint)
});
which is incorrect, throwing the error "Function evOwnerSketchPlane with 1 argument(s) not found".
What is the correct method to evaluate this point and use it to create the sketch?
-----------------------------------------------------------------------------------------------------
The help file tells us we can use a vertex:-
evOwnerSketchPlane (context is Context, arg is map) returns Plane
Return the plane of the sketch that created the given entity.
arg
map
entity
Query
The sketch entity. May be a vertex, edge, face, or body.
Many thanks,
Owen S.
HWM-Water Ltd
Actually, the third thing is that you should filter the targetpoint to only allow sketch entity selections:
annotation { "Name" : "Select Sketch Point(s)", "Filter" : EntityType.VERTEX && SketchObject.YES }
Hope this helps.
Extra filter added to precondition and:-
var sketch1 = newSketchOnPlane(context, id, {
"sketchPlane" : evOwnerSketchPlane(context, {
"entity" : definition.targetpoint
})
});
Did exactly what was required.
Your help is appreciated
Cheers,
Owen S
HWM-Water Ltd