icons like in hole feature?

adamohern
adamohern Member, OS Professional Posts: 216 PRO
How are the icons added on the left of the hole feature length parameters? I don't see any mention of them in the std FS code.

Comments

  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,274 image
    That's not yet exposed to FeatureScript -- will come a bit later (probably with custom icons for your own features).
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc
  • emerson_bottero
    emerson_bottero Member, Developers Posts: 37 ✭✭
    +1 @adamohern. I need it to.
    Hope we can use only the icon with no text either, only mouse tip  whem hover.
  • emagdalenaC2i
    emagdalenaC2i Member, Developers, Channel partner Posts: 867 ✭✭✭✭✭
    Actually you can use exactly the icons of the Hole feature if your annotations are named exactly as in the Hole FS of the std document

    Like in this example:


    <div>FeatureScript 961;</div><div>import(path : "onshape/std/geometry.fs", version : "961.0");</div><div><br></div><div>annotation { "Feature Type Name" : "My Feature" }</div><div>export const myFeature = defineFeature(function(context is Context, id is Id, definition is map)</div><div>&nbsp; &nbsp; precondition</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.holeDiameter, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.cBoreDiameter, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.cBoreDepth, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.cSinkDiameter, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.cSinkAngle, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.tapDrillDiameter, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.holeDepth, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.tappedDepth, LENGTH_BOUNDS);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; annotation { "Name" : "My Length" }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; isLength(definition.tapClearance, LENGTH_BOUNDS);&nbsp; &nbsp; &nbsp; &nbsp;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Define the function's action</div><div>&nbsp; &nbsp; });</div>
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • emagdalenaC2i
    emagdalenaC2i Member, Developers, Channel partner Posts: 867 ✭✭✭✭✭
    @ilya_baran Are there other icons we can use?
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • emagdalenaC2i
    emagdalenaC2i Member, Developers, Channel partner Posts: 867 ✭✭✭✭✭
    I have just found 3 more

    <span>        annotation { "Name" : "My Length" }
            isLength(definition.dx, LENGTH_BOUNDS);
    
            annotation { "Name" : "My Length" }
            isLength(definition.dy, LENGTH_BOUNDS);
    
            annotation { "Name" : "My Length" }
            isLength(definition.dz, LENGTH_BOUNDS);</span><br>
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • MBartlett21
    MBartlett21 Member, OS Professional, Developers Posts: 2,064 ✭✭✭✭✭
    Does offsetX offsetY and offsetZ work?
    mb - draftsman - also FS author: View FeatureScripts
    IR for AS/NZS 1100
  • emagdalenaC2i
    emagdalenaC2i Member, Developers, Channel partner Posts: 867 ✭✭✭✭✭
    No
    Un saludo,

    Eduardo Magdalena                         C2i Change 2 improve                         ☑ ¿Por qué no organizamos una reunión online?  
                                                                         Partner de PTC - Onshape                                     Averigua a quién conocemos en común
  • ilya_baran
    ilya_baran Onshape Employees, Developers, HDM Posts: 1,274 image
    I think you guys got all of them...  We plan on more customization in this area, but it's not the highest priority.
    Ilya Baran \ VP, Architecture and FeatureScript \ Onshape Inc