"Typecheck canBePlane failed", error creating a plane

Mohamed_Ahmed_LT
Mohamed_Ahmed_LT Member Posts: 6 PRO
edited January 2024 in FeatureScript
Can someone help me with this error? it is still creating the plane but failing to sketch on it!!  the millThcik is containing an input in millimeters.
UPDATE: The issue is resulting from using a valuewithunits instead of an integer, I resolved it by dividing by the unit of measurement. However, I am not able to sketch on the resulting plane and the part is failing!.

Tagged:

Comments

  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,278 image
    It's actually the other way around -- the position of the plane origin should be in length units (makes sense if you think about it), so it should be:
    plane(vector(0 * meter, 0 * meter, mthick), vector(0, 0, 1))


    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Mohamed_Ahmed_LT
    Mohamed_Ahmed_LT Member Posts: 6 PRO
    It's actually the other way around -- the position of the plane origin should be in length units (makes sense if you think about it), so it should be:
    plane(vector(0 * meter, 0 * meter, mthick), vector(0, 0, 1))


    Thanks Ilya, this is resolving the plane-creation error. However, I am still struggling with the creation of a sketch on this new plane! I think I am doing something very wrong in here:
  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,278 image
    Yeah, doing it this way you need id+"plane1" in the query instead of makeId("plane1")
    But in a custom feature, it's just much better to not create an actual construction plane and just use newSketchOnPlane
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • Mohamed_Ahmed_LT
    Mohamed_Ahmed_LT Member Posts: 6 PRO
    Yeah, doing it this way you need id+"plane1" in the query instead of makeId("plane1")
    But in a custom feature, it's just much better to not create an actual construction plane and just use newSketchOnPlane
    Thanks Ilya, this was helpful.