Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

calculate vertical and horizontal polyline

Anonymous

calculate vertical and horizontal polyline

Anonymous
No aplicable

Hi Everyone,

 

I was just wondering if there's any idea or lisp to calculate how many verticals and horizontals I have in my drawings.

layer in the same name. drawn in polyline, its frames for windows but I need to know how many I have frames in my project, verticals to be separated from horizontals, please note that this will be for entire high rise building.

I would appreciate if someone can give me any solutions, as it'll save me of time. if there's lisp program or any command.

 

best regards,

 

waseem 

0 Me gusta
Responder
Soluciones aceptadas (4)
2.511 Vistas
45 Respuestas
Respuestas (45)

Anonymous
No aplicable

@ara_neresesian thank you, I will wait, let me know if you need more info about my drawings.

 

regards,

 

waseem 

0 Me gusta

ara_neresesian
Collaborator
Collaborator
Solución aceptada

HI

Here it is, what you need just load the application bay "ap" and type  EL

the rest thing will do by the program.

but before everything i need to inform you 

1- its primary program i need to   change something after your test.

2- this program works based on delta x  and current ucs

3- all polygons must be created from 4 point no more and closed,and in frame layer( just like what you have now in your drawing)

4- its working with  all objects inside the cad file, it can be change   if you want to select objects for calculate not all drawing.

5-Dont trust program, test it with your manual count in a few files,

6-if its was ok then you can use it.

use the program and tell me if its working well or not, 

and if you need something more just let me know. 

good luck

Kent1Cooper
Consultant
Consultant
Solución aceptada

@Anonymous wrote:

.... a lisp or command that give me how many vertical and horizontal I have with no sizes just quantities.


 

Here's another way, that builds in the restriction to 4-sided closed LWPolylines.

(defun C:HVFQ (/ ss n minpt maxpt LL UR delta hor ver); = Horizontal & Vertical Frame Quantities
  (if (setq ss (ssget "_X" '((0 . "LWPOLYLINE") (8 . "FRAME") (90 . 4) (-4 . "&") (70 . 1))))
    (progn ; then
      (repeat (setq n (sslength ss))
        (vla-getboundingbox (vlax-ename->vla-object  (ssname ss (setq n (1- n)))) 'minpt 'maxpt)
        (setq
          LL (vlax-safearray->list minpt)
          UR (vlax-safearray->list maxpt)
          delta (mapcar '- UR LL)
        ); setq
        (if (> (car delta) (cadr delta))
          (setq hor (1+ (cond (hor) (0))))
          (setq ver (1+ (cond (ver) (0))))
        ); if
      ); repeat
      (prompt (strcat "\n" (itoa hor) " horizontal, " (itoa ver) " vertical."))
    ); progn
  ); if
  (princ)
); defun
(vl-load-com)

 

Designed for orthogonal rectangular outlines as in your sample drawing, with the same questions as raised before:  would there ever be non-orthogonal angles, or curves, etc.?

Kent Cooper, AIA
0 Me gusta

Anonymous
No aplicable

@ara_neresesianthank you, I will test this program on different projects and let you know as soon as possible.

 

regards,

 

Waseem  

0 Me gusta

Anonymous
No aplicable

@Kent1Cooperyour program is not working, perhaps your missing something. 

 

regards

 

Waseem 

0 Me gusta

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

@Kent1Cooperyour program is not working, perhaps your missing something.

.... 


It works for me -- perhaps you are.  In your sample drawing attached to Message 19, I get:

Command: HVFQ
624 horizontal, 171 vertical.

 

QSELECT says there are 795 Polylines on the FRAME Layer, so that seems to add up.

Kent Cooper, AIA
0 Me gusta

Anonymous
No aplicable

@Kent1CooperI have tried it on different project, didn't work too 

0 Me gusta

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

@Kent1CooperI have tried it on different project, didn't work too 


"Didn't work" is never enough information.  Did it not load?  Did it load but the command name wasn't recognized?  Did it accept the command, but nothing happened?  Did something happen different from what you expected?  Did it report numbers but not correct numbers?  Were there any error messages?  Etc., etc.

Kent Cooper, AIA
0 Me gusta

Anonymous
No aplicable

@Kent1Cooperit loaded, when I typed the command it gave me this.

 

Assignment to protected symbol:

VER

enter break loop?

with selection yes/no 

 

0 Me gusta

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

@Kent1Cooperit loaded, when I typed the command it gave me this.

 

Assignment to protected symbol:

VER

enter break loop?

with selection yes/no 

 


Interesting that mine doesn't warn me about that....  There is a  (ver)  AutoLisp function that it's not allowing to be interfered with by using it as a variable name.  Change all instances of  ver  [by itself, not as part of longer words] in the code to  vert  instead, and try again.

Kent Cooper, AIA
0 Me gusta

cadffm
Consultant
Consultant

If you not load the code from the vlide..

VLide (open the file and use the [load window] button

 

or if you not set up the vlide to warn by assignment to protected symbols..

Tools

Environment options

General Options

SETQ to protected symbols

 

 

prompt to enter break loop

 

 

 

 

 

 

 

Sebastian

0 Me gusta

cadffm
Consultant
Consultant

@cadffm  schrieb:

If you not load the code from the vlide..

VLide (open the file and use the [load window] button

 

or if you not set up the vlide to warn by assignment to protected symbols..

Tools

Environment options

General Options

SETQ to protected symbols

 

prompt to enter break loop


 Can not edit my original post, so i editing this quote

Sebastian

0 Me gusta

Anonymous
No aplicable

@ara_neresesianplease see attached, I identified all.

 

regards,

waseem

0 Me gusta

Anonymous
No aplicable

@Kent1Coopercan you send it to me as a file, not codes. so I upload it directly to the drawings

0 Me gusta

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

@Kent1Coopercan you send it to me as a file, not codes. so I upload it directly to the drawings


Attached.

Kent Cooper, AIA
0 Me gusta

Anonymous
No aplicable

@Kent1Cooperit says unknown command. I don't know what's the problem

0 Me gusta

ara_neresesian
Collaborator
Collaborator

ok i got it,

yes its possible to count all of them in (top,  mid, bot) independently,

(but this one is a little complicated, )

so i am waiting to see what you want to add 

and i will do all together

good luck

  

0 Me gusta

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

@Kent1Cooperit says unknown command. I don't know what's the problem


Neither do I.  I tried it here, and it still works for me.  Exactly how are you loading it?

Kent Cooper, AIA
0 Me gusta

ara_neresesian
Collaborator
Collaborator

hi

do you something like this?

if yes what is it?

 

Capture.JPG

Anonymous
No aplicable

@ara_neresesian

yes I do

it'll be top and bottom

 

0 Me gusta