
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Good afternoon guys, how are you?
Some time ago I made a post here in the forum help pedinfo to develop a program for me so @Anonymous Uhdend eveloped the program listed below for me, it was perfect !!! but I'd like to know how to make an improvement, I'd like you to do the following:
Initially, the program only draws the squares according to the indicated points, I want you to keep doing this, however,
I would like it to do the same, whenever the square was made in red color, the rectangle added a number "00" * ROMANS * * 2.69 * in the green color, when the rectangle was cyan, add the name "Terreno" * ROMANS * * 2.69 * in yellow color and when yellow is added the name "Construção" * ROMANS * * 2.69 * also in yellow. If the square changes the color from one to the other, the text also changes, for example: I made a square in the red color and then I changed to Cyan, I would like the text also to change.
The position of the text is striped in the image below.
I apologize for the message and for the poor English.
follows a photo,LISP and a .DWG.
(defun c:Subdivide ( / *error* vars vals p1 p2 p3 p4 ang n w)
(gc)
(vl-load-com)
(or *acad* (setq *acad* (vlax-get-acad-object)))
(or *doc* (setq *doc* (vla-get-ActiveDocument *acad*)))
(defun *error* (error)
(mapcar 'setvar vars vals)
(vla-endundomark *doc*)
(cond
((not error))
((wcmatch (strcase error) "*QUIT*,*CANCEL*"))
(1 (princ (strcat "\nERROR: " error)))
)
(princ)
)
(vla-endundomark *doc*)
(vla-startundomark *doc*)
(setq vars '("cmdecho" "osmode"))
(setq vals (mapcar 'getvar vars))
(mapcar 'setvar vars '(0 0))
(command "_.expert" (getvar "expert")) ;; dummy command
(and
(setq p1 (getpoint "\nP1: "))
(setq p2 (getpoint p1 "\nP2: "))
(setq p3 (getpoint p2 "\nP3: "))
(or
(not (equal (angle p1 p2)(angle p1 p3) 1e-4))
(alert "\nPoints are all in a straight line.")
)
(not (initget 7))
(setq n (getint "\nEnter quantity of parcels to create: "))
(setq ang (angle p2 p3))
(setq w (/ (distance p2 p3) n))
(repeat n
(setq p3 (polar p2 ang w)
p4 (polar p1 ang w)
)
(vl-cmdf "_.pline" p2 p3 p4 p1 "_C")
(setq p2 p3 p1 p4)
)
)
(*error* nil)
)
(defun c:SD ()(c:Subdivide))
Solved! Go to Solution.