1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Script Pre Release: Length of chosen 3D-sketch

Discussion in 'Alibre Script' started by idslk, Mar 19, 2021.

  1. idslk

    idslk Alibre Super User

    Hello colleagues,

    this is a pre release of a skript that allows you to get the length of a 3D-sketch.
    This release is limited to lines and circular-arcs. testing was very limited... only on a german installation.
    Here are some pictures (using a design file from THIS POST)


    choose your units


    choose the sketch


    Get the result :)


    As "always" - Use at your own risk!!!
    It would be nice if i get some comments ;-)


    Script updated from 0.1 to 0.2

    Attached Files:

    Last edited: Mar 19, 2021
    oldfox and Eddy So like this.
  2. simonb65

    simonb65 Alibre Super User

    My only comment is that if you can do that in 1 day ... why can't Alibre? :confused: (ok ... I'd give them 2 days so they can test it too ;))

    Seriously, you could get the units from the design and pre-select the units. Other than that, brilliant!

    This is where we need the ability to add scripts as toolbar/ribbon buttons to extend the toolbar functionality rather than loading/running scripts through the AlibreScript UI.
    TimoCAD likes this.
  3. idslk

    idslk Alibre Super User

    Hopefully done, if you like to try... i've added the new version to first post.
    Have also added a check on not supported elements - the script interrupts now his work. Before this, the script tries to add a spline with a length of 0 and calculated a wrong length in sum. So now you should get only a correct length.


    Last edited: Mar 19, 2021
  4. sz0k30

    sz0k30 Senior Member

    Just as a point of reference: I am a hobbyist, long retired, former Chassis designer. As such I did a lot of hoses & tubes. Radiator hoses, fuel line tubes, brake line tubes, exhaust pipes. All were designed using lines and arcs. The only place we used splines was routing wires and harnesses. All tubes, pipes and hoses were dimensioned to theoretical intersections on 2D drawings (which Alibre also does very poorly).

    Stefan, I'm honored to have one of your scripts created for me. In my simple jobs I have never had to use scripts. Looks like now I will have to learn.

    TimoCAD likes this.
  5. GIOV

    GIOV Alibre Super User

    Excellent Stefan.

    Attached Files:

  6. GIOV

    GIOV Alibre Super User

    Hi Stefan
    I would like that you modify your script for to do the same calculus in 2D Sketch and also able to add nodes at the same path distance obeying the qty of path distances as input. (Divide).
    Thanks in advance.
    Last edited: Mar 22, 2021
  7. oldfox

    oldfox Alibre Super User

    Well done Stefan. Give yourself a pat on the back. And as always, stay safe.
  8. BlackBird28

    BlackBird28 Member

    don't work here...
    drawn a simple 3d sketch without anything else and get an error message

    The installed AlibreScriptVersion equals 343293 as expected!
    The installed AlibreVersion equals PRODUCTVERSION 22,0,3,22061 as expected!
    sorry, there is a non supported geometry in the 3D-sketch! The length can not be calculated!
  9. simonb65

    simonb65 Alibre Super User

    "This release is limited to lines and circular-arcs" ... what does you simple sketch consist of? A screen image of your 3d sketch would be useful.
  10. oldfox

    oldfox Alibre Super User

    I just opened this post to say that -- you beat me to it. Plus, only cm and inch are defined in the "unitlist".
  11. BlackBird28

    BlackBird28 Member

    Oh.. i used a spline to test it... sorry...
  12. idslk

    idslk Alibre Super User

    Script Update 3D and NEW 2D!

    UPDATE: Length of chosen 3D-Sketch
    0.3 # - writing to user defined property "Path_length" added*
    This property can be used in a BOM**
    - Units "feet" and "unknown" added
    and no, furlongs won't be added ;-)

    NEW: Length of chosen 2D-Sketch
    0.13 #- initial
    - Units automated and filter for unsupported elements added
    (only ellipse, eliptical arc and spline - The rest is supported.
    If you have a sketch with a plate with holes in it,
    you will get the outer border length as well as the border length of the holes)
    - writing to a user defined property added*
    - Units "feet" and "unknown" added

    *Here comes a short explanation "How to add a Custom Property" (small picture, better quality in appended PDF)
    I would have liked to do this with the script, but you can guess...There is no official method provided in AlibreScript ot the API - Sorry.

    **Here is a pictures of "How to use the Custom Property" in a BOM (only as an example)(small picture, better quality in appended PDF):

    As "ever": Use at your own risk!!!
    and please leave a comment...;)


    Attached Files:

  13. GIOV

    GIOV Alibre Super User

    Ok Stefan. Do not forget the Divide 2D & 3D path by nodes;)!

Share This Page