hanhphuc Posted May 25, 2018 Posted May 25, 2018 (edited) ;;;............FIND DETAILS OF CIRCLE INSIDE A BLOCK......................... How can I get the present location of the circle.[/quote] if direction normal & 2D circle (1st level nested), try this simple conversion.. [code] [color="green"];vlisp [/color] (defun PtInsideBlock (en p / ob bp l ) (setq bp '(0. 0.) ob (vlax-ename->vla-object en) l (mapcar ''((x) (vlax-get ob x)) (vl-list* 'ObjectName 'InsertionPoint 'Rotation (mapcar ''((x) (strcat x "Effectivescalefactor")) '( "X" "Y" )) ) ) p (mapcar '* p (cdddr l)) ) (if (= (car l) "AcDbBlockReference") (mapcar '+ (cadr l) (polar bp (+ (angle bp p) (caddr l)) (distance bp p)) ) ) ) [color="green"];pure vanilla [/color] (defun PtInsideBlock (e p / bp e l ) (setq bp '(0. 0.) e (entget e) l (mapcar ''((x)(cdr (assoc x e))) '(0 10 50 41 42 )) p (mapcar '* p (cdddr l)) ) (if (= (car l) "INSERT") (mapcar '+ (cadr l) (polar bp (+ (angle bp p) (caddr l)) (distance bp p)) ) ) ) assign en variable (repeat (setq i (sslength xss2)) (setq e(entget (setq [b][color="red"][u]en[/u][/color][/b] (ssname xss2 (setq i (1- i)))))) ... ... ... [color="red"](setq [b]center[/b] (cdr (assoc 10 get))) (princ (strcat "\nCenter = "(vl-princ-to-string ([color="blue"]PtInsideBlock[/color] [b][u]en[/u][/b] [b]center[/b] )))) [/color] ... ... ... minimal tested which supports block with & w/out uniform scale Edited May 25, 2018 by hanhphuc vanilla code added Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.