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

insert "coordinated" quotas on the top of a polylinea

  • Thread starter Thread starter frk
  • Start date Start date

frk

Guest
I realized, with the precious help of gp, that I thank again, this lisp.

starts with "cd"

attention to the indications at the beginning.

is very dependent on the used quota style.
Code:
; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
; | lisp to insert on all the vertices of a polylinea coordinate quota |
; | (ordered in uk) x and y with base point (ucs 0.0) to be defined |
; | note: the coordinates will depend on the current quota style in the dwg |
; | values are always and only positive: act on the q style. x negatives |
; --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


(defunc c:cd (/ ent idx pts totparam p1 pttt pttx ptty)

(command "_ucs" "_w")

(command "_point" breaks)
(setq p1 (getvar "lastpoint")
(command "_ucs" p1)

(vl-load-com)

(if (setq ss) ((0 .*poly*)))))
(progn)

(vla-startundomark (vla-get-activedocument (vlax-get-acad-object)))
(setq idx)

(while (< (setq idx (1+ idx))(ssslength ss))
(setq ent (ssname ss idx))
(setq totparam (fix))
(Sectq i)

(while (< (setq i (1+ i)) totparam)
(setq pt (vlax-curve-getpointatparam ent i))

(setq ptt (- (car pt) (car p1)) (- (cadr p1)))
(setq kk 30) ;write here the shift of the second point of the ordered quota in x and y
;the same value to be inserted in the quote style -lines and arrows- -offset from the origin-
(setq pttx (+ kkk (car ptt)))
(setq ptty (+ kkk))
(command "_dimordinate" ptt ".yz" ptt pttx)
(command "_dimordinate" ptt ".xz" pttty)
)

(setq pt (vlax-curve-getpointatparam ent)
(setq ptt (- (car pt) (car p1)) (- (cadr p1)))
(setq kk 30) ;write here the shift of the second point of the ordered quota in x and y
;the same value to be inserted in the quote style -lines and arrows- -offset from the origin-
(setq pttx (+ kkk (car ptt)))
(setq ptty (+ kkk))
(command "_dimordinate" ptt ".yz" ptt pttx)
(command "_dimordinate" ptt ".xz" pttty)
)

(vla-endundomark (vla-get-activedocument))
)
)
(princ)
)
 
ciao,

ma cosa vuol dire che per i negativi dipende dallo stile quota.......in pratica per visualizzare le quote negative cosa bisogna fare?

bb
 
ecco qua, con questa piccola modifica al file cd.lsp le coordinate possono assumere anche valori negativi.
 

Attachments

Forum statistics

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

Members online

No members online now.
Back
Top