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

management frame length of a furniture style

  • Thread starter Thread starter elbaha
  • Start date Start date

elbaha

Guest
Good morning to all, my name is fabio and furniture design in style
a few years ago, also helped by your professionalism, I tried to automate the extraction of the length of a frame through attributes, reading the length of a polylinea and transferring it to an empty attribute

The syntax is this:
(defun c:corniceu1 (/ ss lis idx obj)
(vl-load-com)
(setvar "cmdecho" 0)
(setq a_tot 0)
(command "_area" "_o" "_l")
(setq ac (rtos (/ (getvar "perimeter") 1) 2 2))
(setq acc (vl-string-subst," ac))
(setq width (getint " insert width :"))
(setq thickness (getint " insert thickness :"))
(setq ins_p (getpoint "\n start frame :"))
(command "-inser" "cornice.dwg" ins_p "" """ thickness width acc "")
(princ)

everything works perfectly but, if in the same design select the initial point of another polyline to determine the length, this is the answer:

frame start:
*no valid selection*
requires a point or last
; error: function canceled

Can you please give me a hand?

thanks in advance

fabio
 
The problem lies here
(command "_area" "_o" "_l") i.e. last.
you are telling autocad to calculate the area (and then the perimeter) of the object Last who designed

Unfortunately I don't have time to change the list, but seat replace the last with a selection of any item of the drawing - and this involves that you must also do a check on the type of entity selected, because if you select something type line, quota, not having area the program crashes.
 
The problem lies here
(command "_area" "_o" "_l") i.e. last.
you are telling autocad to calculate the area (and then the perimeter) of the object Last who designed

Unfortunately I don't have time to change the list, but seat replace the last with a selection of any item of the drawing - and this involves that you must also do a check on the type of entity selected, because if you select something type line, quota, not having area the program crashes.
Thank you. I can fix the code.
Good evening
fabio
 

Forum statistics

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

Members online

No members online now.
Back
Top