• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

add selected polyline lengths and block count

  • Thread starter Thread starter brizzo1982
  • Start date Start date

brizzo1982

Guest
hi guys..sto politely looking for a lisp utility that allows me to perform the sum of the lengths of the selected polylines. I searched but found only functions to count the sum of the length of the lines, not polylinee.
Secondly I am looking for a function that started, I can provide a report with the total number of blocks present in the drawing divided by name.

Can someone help me?

Thank you.. and good work to all! :finger:
Hi.
 
In fact I did a lisp to count the lines and not the polylines (it is called sommeline.lsp). for the counting of the plinths there are 2 roads: to explode them or to change the lisp to make sure that it also takes the beads.

for the second question, I think there's a command in the express that suits you. if you only need to count all the blocks with a certain name in the design and see where they are, you can use my conblok.lsp.
 

Attachments

cabbage, nn manages to sum + polylinee, some magnanimo that explains me by thread and by sign how do you do it? sommeline works perfectly but I need to measure polylines. . Thank you.
 
test this; part with pllen.
There are others on the net.
if it does not work, enter the command line before launching it:
(vl-load-com) sending
 

Attachments

cabbage, nn manages to sum + polylinee, some magnanimo that explains me by thread and by sign how do you do it? sommeline works perfectly but I need to measure polylines. . Thank you.
the command summaryline.lsp actually sums only the lines: So just explode the polylines before launching the command, or (as I said) you need to change the lisp to get him to take the polylines too.
the simplest way is the one where the lisp explodes, the sum and then rebuilds it; the most elegant street is to treat polylinea as "complex entity". the problem in this case is that a hexadecimal name is returned which represents a point; but this point is not the beginning of polylinea, but the summit closest to the point of selection. therefore it is necessary to pass all the vertices, until you reach the bottom where there is a hexadecimal name that represents the first summit (finally!). at that point you are sure to take polylinea in its entirety and then you can find the length or do any other operation on the polylinea.

this to say that it is not a banal modification of the lisp ....

There are probably other easier roads and if anyone knows, I will be happy to have your help.... .
 
Mythics....thank you, pllen works perfectly. Now, because of the block count I'm a little "blocked"...heheheheheh.... conblok nn works me or maybe I can use it well...any delucidation?
 
Mythics....thank you, pllen works perfectly. Now, because of the block count I'm a little "blocked"...heheheheheh.... conblok nn works me or maybe I can use it well...any delucidation?
conblok works like this:

- loads -> (load"conblok")
- launches -> conblok
- asks you the name of the block to search (attention to the capital)
- if you answer with a sending...
- asks you to click on a block (it is easier than remembering exactly the name!)
It tells you how many blocks there are with that name...
- at this point if you give another sending, conclude the program (end)....
If you click in an empty area of the design, all lines are drawn from that point and go to the point of insertion of the blocks.
In this way it is easy to find them.

the blocks are placed in a selection set: this means that to program completed, if you want to select (e.g. to move or to delete) all the found blocks, you just have to give the "p" selection command (previous).

e.g. found all the "sedia" blocks present in the drawing. then give the command "setting" "p" (send) and this allows you to select and move all the chairs together.
 
boys to count the number of polylines we have with pllen, but for sum the lengths how do you do it?
 
hi I saw this topic that interests me, I wanted to ask all of you if you can count blocks on a portion of the design selectable and implement it in the lisp conblock.

in practice use conblok though adding a function that allows you to select the drawing portion where you can count the blocks

Thank you.
 
thanks gp. I asked what I was interested in knowing and deepening the lisp code for selecting portions of drawing maybe to be implemented also on other functions (not just counting blocks).
I'm studying the guide and I've seen that there's ssget to make the selections. I simply wanted an example lisp to understand how to select portions of drawing to use them in other functions.
Thank you.
 
the command summaryline.lsp actually sums only the lines: So just explode the polylines before launching the command, or (as I said) you need to change the lisp to get him to take the polylines too.
the simplest way is the one where the lisp explodes, the sum and then rebuilds it; the most elegant street is to treat polylinea as "complex entity". the problem in this case is that a hexadecimal name is returned which represents a point; but this point is not the beginning of polylinea, but the summit closest to the point of selection. therefore it is necessary to pass all the vertices, until you reach the bottom where there is a hexadecimal name that represents the first summit (finally!). at that point you are sure to take polylinea in its entirety and then you can find the length or do any other operation on the polylinea.

this to say that it is not a banal modification of the lisp ....

There are probably other easier roads and if anyone knows, I will be happy to have your help.... .
I discovered from an old lisp that you can get the length of an object (linea - plinea - arc etc.) giving the command stretch (_lengthen in English) and selecting the object without obviously varying the length. the value found goes to end in the variable system parameters. This opens me a world!!! the above mentioned lisp would become much easier to improve: you don't have to shake the complex entities! !
It is true that you never stop learning!

I will try to improve sommeline.lsp and then I will let you know!
 
I discovered by an old lisp that you can get the length of an object....
....you don't need to shake the complex entities! !
to get the length any He said:

(vl-load-com)
(setq e1 (vlax-ename->vla-object)
(setq l:e1 (vlax-curve-getdistatparam e1 (vlax-curve-getendparam e1)))

:smile:
 
now summaryline.lsp accepts:

lines
polyline
polyline 3d
splines
arches
ellipses (or elliptical arches)
 

Attachments

Hello, everyone.
but for counting blocks contained in the drawing it is no longer useful to use tables or fields?
in this way everything remains under autocad control.
 
to get the length any He said:

(vl-load-com)
(setq e1 (vlax-ename->vla-object)
(setq l:e1 (vlax-curve-getdistatparam e1 (vlax-curve-getendparam e1)))

:smile:
Bye. I tried to launch the pl-len command but after selecting the polyline gives me the following error:
; error: no function definition: vlax-ename->vla-object

Where can I correct?
 
now summaryline.lsp accepts:

lines
polyline
polyline 3d
splines
arches
ellipses (or elliptical arches)
I exempt this old discussion. and I apologize for ignorance. but how do you use summaline?? I managed to charge it but not to use it
 
(load "sommaline") send (to load it)

summaline sending (to launch it)

click on the entities (lines - polylines etc.) one by one ... and conclude with sending

gives you to video the result, if you want me to write it in a text, click where you want the text and give it the height (or accept with sending that proposal).
 
(load "sommaline") send (to load it)

summaline sending (to launch it)

click on the entities (lines - polylines etc.) one by one ... and conclude with sending

gives you to video the result, if you want me to write it in a text, click where you want the text and give it the height (or accept with sending that proposal).
I feel like I can't charge it properly. yet I correctly load the lisp with the command _appload
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top