Enter distances automatically between vertices - Inserir distância pl

Enter distances automatically between vertices - Inserir distância pl

Anonymous
Not applicable
1,784 Views
8 Replies
Message 1 of 9

Enter distances automatically between vertices - Inserir distância pl

Anonymous
Not applicable

Boa Noite.

 

Digito pl e vou inserindo as distancias entre os pontos, depois eu vou digitando as distancias uma por uma, gostaria de saber se no Cad tem algum comando que inserisse automaticamente essas distancias ou apenas lisp mesmo?

Vou colocar uma imagem para exemplificar melhor

 

Obrigadodistancias.jpg

 

0 Likes
Accepted solutions (3)
1,785 Views
8 Replies
Replies (8)
Message 2 of 9

Kent1Cooper
Consultant
Consultant

I don't know the language, but the image seems clear enough.  Try DimPoly.lsp with its DPI and DPO commands, available here.  Make a Dimension Style that has both extension lines and both dimension lines suppressed, and that has the 'm' suffix built in.

Kent Cooper, AIA
0 Likes
Message 3 of 9

Anonymous
Not applicable

hahaha I from Brazil, sorry, I do not write very well, but thanx a lot for help me.

New attachment

A picture is worth a thousand words

 

Thanx a lot again

 

 

0 Likes
Message 4 of 9

Kent1Cooper
Consultant
Consultant

Yes, you can do that, as described before.

 

In the _DIMSTYLE command, make a New Dimension Style, and in its settings, choose to suppress both extension lines and both dimension lines, and give it a suffix of "m".  Make that Style current, and then run DPI or DPO.

 

LineSuppr.PNG

 

 

mSuffix.PNG

Kent Cooper, AIA
0 Likes
Message 5 of 9

stevor
Collaborator
Collaborator
Accepted solution

One way:


(princ"\n  Seg Dis Texts")
     
(princ"\n Text Offset Dist ")
 
 ; Set Text Offset Distance and Size
 (textscr) (graphscr)
 (setq D (if *TOH *TOH (getvar 'textsize))
       ;*TOH (Get_D *TOH "\n Text Offset Dist")
       A (Getdist (strcat
              "\n Pick Text Offset Dist <" (rtos D) ">: "))
       *TOH (if A A D)  ) ; s  (PP_"*TOH")

(princ" Def ")

 ; Label Pline Segment Lengths, Texts Upward, w/layer
 (Defun C:PST (/ VPL ES EN VON EON HPI 3HP AS TSR MP DS WTS
                 TP TP1 TP2 VP PVP AS  TLN  ) ;
  (setq TLN "SegDis" HPI (/ pi 2)  3HP (+ pi (/ pi 2)) )
  (princ (strcat "\n Layer Name for Text: " TLN ))                
  (if (and (setq ES (entsel "\n Sel Pline:"))
           (setq EN (car ES))
           (setq EON (vlax-ename->vla-object EN) )
           (setq VON (vla-get-objectname EON))
           (or (= VON "AcDbPolyline" )
               (and (princ"\n /= ") (princ VON) nil)) )
    (progn  
     (setq VCL (vlax-get EON 'coordinates))
     (repeat (/ (length VCL) 2)
      (setq VPL (cons (list (car VCL) (cadr VCL) ) VPL)
            VCL (cddr VCL))
     )
     ;
     (setq PVP (car VPL)  )
     (foreach VP (cdr VPL)  
      (setq AS (angle PVP VP)  DS (distance PVP VP) ; ANG DIS
            TSR (rtos DS 2 2)  MP (polar PVP AS (/ DS 2.)) ; MID
            TP1 (polar MP (+ AS HPI) *TOH)  
            TP2 (polar MP (- AS HPI) *TOH)       
            AST (if (and (> AS Hpi) (< AS 3HP))  (+ AS pi) AS)
            TP  (if (and (> AS Hpi) (< AS 3HP))  TP2  TP1 )  
            ; TP (if (< (cadr TP1) (cadr TP2))  TP2  TP1 )  
            WTS (rtos DS 2 2)   PVP VP
            WTS (vl-string-right-trim "0" WTS )
            WTS (Strcat (vl-string-right-trim "." WTS) "m")
      )  
      (entmake  (list '(0 . "TEXT")  
       (cons 10 tp)  (cons 11 tp)   ; Insertion, Alignment Pt
       (cons 1 WTS)  (cons 40 *TOH)  ; String, Height
       (cons 8 TLN)
       (cons 50 AST)  '(72 . 1)  '(73 . 2)  ; Angle Center Middle  
      ))  ) ) ) (princ) ) ;
     
(princ"  do c:PST: ")     (c:PST )

S
0 Likes
Message 6 of 9

stevor
Collaborator
Collaborator
A simple method, in autolisp, is at http://www.auscadd.com/free-lsp-2.html. Tried posting it here twic, no luck.
S
0 Likes
Message 7 of 9

Kent1Cooper
Consultant
Consultant

@stevor wrote:

One way:

....
 ; Label Pline Segment Lengths, Texts ....

....
      (entmake  (list '(0 . "TEXT")  
....


The big advantage of using something like DimPoly.lsp, which uses Aligned Dimensions  rather than Text, is that if you Stretch the Polyline's vertices around, the distance content  and the rotation angles  and the centering  of the length indications update automatically  for you [though you will have to adjust the distance-off-the-Polyline-segment position of some  of them, depending on which vertex in relation to their defined position was Stretched].

Kent Cooper, AIA
0 Likes
Message 8 of 9

Kent1Cooper
Consultant
Consultant
Accepted solution

@Kent1Cooper wrote:

.... make a New Dimension Style, and in its settings, choose to suppress both extension lines and both dimension lines, and give it a suffix of "m".  ....

 


I should have added that the Dimension Text should be set centered in both directions and aligned with the dimension line [here from the Text tab in the Dimension Style dialog box]:

DimStyleTxt.JPG

Kent Cooper, AIA
0 Likes
Message 9 of 9

Anonymous
Not applicable
Accepted solution

thanx a lot Kent1Cooper and stevor, god bless you all 🙂

0 Likes