naming closed polylines and count

naming closed polylines and count

cizimcenter
Participant Participant
2,169 Views
31 Replies
Message 1 of 32

naming closed polylines and count

cizimcenter
Participant
Participant

I am working on curtainwall manufacturing drawing task in which I need to give unique number and need to make table with layer, width, length and count of each glass panel. Then i need to write names into each polylines center as a installation scheme.
But is it possible to add number with prefix and/or suffix (for example GL1-1,GL1-2,GL1-3) Automatically instead of just 1, 2, 3 ,4..... type number? A sample file is attached.
Can you please help with this? 

0 Likes
Accepted solutions (1)
2,170 Views
31 Replies
Replies (31)
Message 21 of 32

Sea-Haven
Mentor
Mentor

@-didier- I suggested rotating the pline vertices so the start is always lower left and CCW so always get length and height from the the 3 vertices, no need for an area check, in saying this the sloping plines may need more thought. This may be helpful.

 

; thanks to dexus @ theswamp

(defun rotate-rectang (lst / corner)
  (setq corner ; find left most corner with a sort
    (car
      (vl-sort lst
        (function
          (lambda (a b)
            (if (equal (car a) (car b) 1e-4)
              (< (cadr a) (cadr b))
              (< (car a) (car b))
            )
          )
        )
      )
    )
  )
  (while (/= (car lst) corner) ; rotate until corner is the first item
    (setq lst (append (cdr lst) (list (car lst))))
  )
  lst ; return lst
)
 
(rotate-rectang '((3240.0 1074.0) (3440.0 1074.0) (3440.0 1174.0) (3240.0 1174.0)))

 Do a CW or CCW check 1st. 

0 Likes
Message 22 of 32

Brock_Olly
Collaborator
Collaborator

Didier,
This is a wonderful job, I'm sure many people could benefit from these commands!
I would also be interested in the LISP when you're done. Take your time.


0 Likes
Message 23 of 32

-didier-
Advisor
Advisor

Bonjour @cizimcenter 

 

I am sorry for the slow response, but I promise you that I am looking for solutions.

The concern is that the days are only 24 hours and I take care of the grandchildren, work in the garden, at home, practice sports, and finally I come back to the PC


I changed my way to filter polylines, I work on the dimensions and this way it is more precise and unitary than the choice by area.
I still have to solve two/ three small problems because I want it to work in any case, and I will quickly deliver the program.

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

Message 24 of 32

-didier-
Advisor
Advisor
Accepted solution

Bonjour @cizimcenter 

 

The time has finally come!
This is the latest version that I think meets demand effectively.
I remain available for any adjustments or corrections if necessary.

 

Command names are : cizimcenter / creatable / legende

 

Amicalement

 

 

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

Message 25 of 32

cizimcenter
Participant
Participant

Hi @-didier- 

i have just tried and the commands work very well. You did it perfectly. Thanks a lot.

note: the text height in the table is very small but it is not problem. i can resize the table.

 

cizimcenter_0-1745087335529.png

is it possible to round dimensions and merge GL-100 and GL-101? Because glass manufacturers do not work with precise measurements.

 

0 Likes
Message 26 of 32

Sea-Haven
Mentor
Mentor

@cizimcenter "the text height in the table is very small but it is not problem."

 

mine
(setq objtable (vla-addtable vgms sp numrows numcolumns rowheight colwidth))

other
  (setq table (vla-addtable
		(vla-get-modelspace *acdoc*)
		(vlax-3d-point ptable)
		(+ (length lt2) 2)
		5 420 1150 ))
  (vla-put-VertCellMargin table 4.0)

Look at the 420 compared to say the 4.0 the row height would be like 18 ? Try a few values. leave the 4.0 as is. You can also set textheight for a row.

 

0 Likes
Message 27 of 32

symoin
Enthusiast
Enthusiast

This is a wonderfull lisp code,  Can I request you to  to include the coordinates for the vertices of the polygons in the table?

0 Likes
Message 28 of 32

Sea-Haven
Mentor
Mentor

Just a quick question how do you want the co-ordinates shown X,Y or X Y X Y X Y X Y, 4 columns or 8 ? I am sure @-didier- will add once you answer.

0 Likes
Message 29 of 32

-didier-
Advisor
Advisor

Bonjour @symoin 

 

Thank you for the compliments.
I never do anything in order to have a thank you or compliments but when they arrive I am happy to be part of the community.
For your coordinates details, it is possible (anything is possible) but I would need an example of the result to be obtained.
Draw a table “by hand” as you imagine it finished, and I will look at how to automate the task.

 

It will probably be wise to create a new message so as not to pollute this discussion with different requests.

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 30 of 32

symoin
Enthusiast
Enthusiast

It's great to see your response, and sorry for the delay. Here are the files.

0 Likes
Message 31 of 32

-didier-
Advisor
Advisor

Bonjour @symoin 

 

OK, I have all what I need to write your program.
You understand that I am very busy, and then I can not promise a specific date of return.

 

Amicalement

Éternel débutant.. my site for learning : Programmer dans AutoCAD

DA

EESignature

0 Likes
Message 32 of 32

symoin
Enthusiast
Enthusiast

Thanks a lot, No hurry, appreciate your efforts and time.

Thanks again

0 Likes