What's new

Script Pre Release: Length of chosen 3D-sketch

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)

upload_2021-3-19_16-49-12.png

choose your units

upload_2021-3-19_16-49-35.png

choose the sketch

upload_2021-3-19_16-50-5.png

Get the result :)

upload_2021-3-19_16-50-29.png

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

Regards
Stefan

Script updated from 0.1 to 0.2
 

Attachments

  • Length_of_chosen_3DSketch_02.py
    4.3 KB · Views: 22
Last edited:

simonb65

Alibre Super User
It would be nice if i get some comments ;-)
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.
 

idslk

Alibre Super User
Seriously, you could get the units from the design and pre-select the units
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.

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.
+1

Regards
Stefan
 
Last edited:

sz0k30

Senior Member
This release is limited to lines and circular-arcs.

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.

Thanks.
 

GIOV

Alibre Super User
Excellent Stefan.
index.php

index.php

upload_2021-3-19_18-54-27.png
 

Attachments

  • upload_2021-3-19_18-46-54.png
    upload_2021-3-19_18-46-54.png
    121.7 KB · Views: 7

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:

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!
AD_MILLIMETERS
sorry, there is a non supported geometry in the 3D-sketch! The length can not be calculated!
 

oldfox

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.

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

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.
upload_2021-3-23_16-53-23.png

**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):
upload_2021-3-23_16-53-43.png

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

Regards
Stefan
 

Attachments

  • Length_of_chosen_3DSketch_03.py
    4.9 KB · Views: 6
  • Length_of_chosen_2DSketch_013.py
    5.4 KB · Views: 7
  • Use_a_Custom_Property_in_a_BOM.pdf
    123.4 KB · Views: 7
  • Create_Custom_Property.pdf
    127.7 KB · Views: 7
Top