Circle Block to Circle Block Dimension Only Text

Circle Block to Circle Block Dimension Only Text

Gaganpatel
Collaborator Collaborator
882 Views
7 Replies
Message 1 of 8

Circle Block to Circle Block Dimension Only Text

Gaganpatel
Collaborator
Collaborator

 

Hi every one,

 

I have circle block to circle block dimension only text auto lisp file.

 

Please see the example file.

 

 

Thanks & Regards

 

Kalandi Paital

0 Likes
883 Views
7 Replies
Replies (7)
Message 2 of 8

Gaganpatel
Collaborator
Collaborator

Please help sir

0 Likes
Message 3 of 8

Anonymous
Not applicable

Sorry for any grammatical error, I'm using google to translate.

Could you be more specific in your question?

 

 

 

Júnior Nogueira.

Por favor,  Aceitar como Solução se meu post te ajudar.

Please Accept as Solution if my post helps you.

0 Likes
Message 4 of 8

hak_vz
Advisor
Advisor

You have already asked this question before and received answer to it on 15.03.2018.

 

Use given autolisp code to edit dimensions.

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/circle-to-circle-dimension-only-text...

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 5 of 8

marko_ribar
Advisor
Advisor

Here you go... Quick and simple...

 

(defun c:bc2bcdims2txt ( / ss ax ts ip sp revf i e el dl str txts )

  (vl-load-com)

  (prompt "\nSelect circle blocks...")
  (setq ss (ssget '((0 . "INSERT"))))
  (setq ax (entsel "\nPick axis where blocks are aligned - picking near desired start point..."))
  (initget 7)
  (setq ts (getdist "\nPick or specify text size : "))
  (initget 1)
  (setq ip (getpoint "\nPick or specify insertion point of text : "))
  (if (and ss ax ts ip)
    (progn
      (setq sp (vlax-curve-getclosestpointto (car ax) (cadr ax)))
      (if (> (distance sp (vlax-curve-getstartpoint (car ax))) (distance sp (vlax-curve-getendpoint (car ax))))
        (setq revf t)
      )
      (repeat (setq i (sslength ss))
        (setq e (ssname ss (setq i (1- i))))
        (if (< (distance (cdr (assoc 10 (entget e))) (vlax-curve-getclosestpointto (car ax) (cdr (assoc 10 (entget e))))) 0.25)
          (setq el (cons e el))
        )
      )
      (setq el (vl-sort el '(lambda ( a b ) (if revf (> (vlax-curve-getdistatparam (car ax) (vlax-curve-getparamatpoint (car ax) (vlax-curve-getclosestpointto (car ax) (cdr (assoc 10 (entget a)))))) (vlax-curve-getdistatparam (car ax) (vlax-curve-getparamatpoint (car ax) (vlax-curve-getclosestpointto (car ax) (cdr (assoc 10 (entget b))))))) (< (vlax-curve-getdistatparam (car ax) (vlax-curve-getparamatpoint (car ax) (vlax-curve-getclosestpointto (car ax) (cdr (assoc 10 (entget a)))))) (vlax-curve-getdistatparam (car ax) (vlax-curve-getparamatpoint (car ax) (vlax-curve-getclosestpointto (car ax) (cdr (assoc 10 (entget b)))))))))))
      (setq dl (mapcar '(lambda ( a b ) (distance (cdr (assoc 10 (entget a))) (cdr (assoc 10 (entget b))))) el (cdr el)))
      (setq txts (strcat "-" (substr (setq str (apply 'strcat (apply 'append (mapcar '(lambda ( x ) (list (if (< 0.25 (- x (fix x)) 0.75) (strcat (itoa (fix x)) ".5") (rtos x 2 0)) "+")) dl)))) 1 (1- (strlen str))) "-"))
      (vl-cmdf "_.TEXT" "_non" ip ts (cvunit (if revf (angle (vlax-curve-getendpoint (car ax)) (vlax-curve-getstartpoint (car ax))) (angle (vlax-curve-getstartpoint (car ax)) (vlax-curve-getendpoint (car ax)))) "radian" "degree") txts)
    )
  )
  (princ)
)

HTH., M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 6 of 8

Gaganpatel
Collaborator
Collaborator

 

Dear Sir,

 

Thanks

 

Please give me salutation for text size default and text place for circle position align.

0 Likes
Message 7 of 8

marko_ribar
Advisor
Advisor

Just change (setq ts ... ) and (setq ip ... ) to suit your needs...

For me it's working as it is without any problem... So it is solution at least for me...

 

Regards, M.R.

Marko Ribar, d.i.a. (graduated engineer of architecture)
0 Likes
Message 8 of 8

Gaganpatel
Collaborator
Collaborator

Dear Sir,

 

Thanks

 

Please give me salutation for text size default and text place for circle position align.

Please help me.

0 Likes