Dimension for all blocks by lisp

Dimension for all blocks by lisp

ritzofriya
Advocate Advocate
2,027 Views
7 Replies
Message 1 of 8

Dimension for all blocks by lisp

ritzofriya
Advocate
Advocate

Is that possible to get dimension with nearest blocks or wall in once click ?

0 Likes
2,028 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant

An image of what you're asking about would be helpful, with a description of the steps the User would take.  Call the command, pick a Block, and see its distance from the nearest wall?  Or from the nearest other object of any kind?  If a wall, is that a wall object that knows it's a wall, such as in AutoCAD Architecture, or just a Line?  Report the distance at the command line, or draw an actual Dimension object showing it?  See its distance from the nearest other Block?  Any Block?  Or just the nearest of the same name?  If Blocks are involved, would the distance be to or from their insertion points, or any part of them?  Etc., etc.

 

Or am I completely misunderstanding the intent?

Kent Cooper, AIA
Message 3 of 8

ritzofriya
Advocate
Advocate

Capture.JPG

 SS attached, here the red is my blocks, have to make dimensions as mentioned always (block to block and block to wall). hope you program genius can make some automatic system for the same. Kindly let me know how can I help you more the same.

0 Likes
Message 4 of 8

Sea-Haven
Mentor
Mentor

Looking at the dwg a couple of the dimensions if being used for construction are very difficult to work out. Look at left dim on sloping line, that is very hard to measure, but could be used as a check distance but again due to slope will give correct even when wrong withot a lot of care. The middle dim goes to the dim line not the object again ?

0 Likes
Message 5 of 8

ritzofriya
Advocate
Advocate

Yes, i got your point,

 

If we can get a startup for dim, then we have to do only the corrections, that is why.

0 Likes
Message 6 of 8

Sea-Haven
Mentor
Mentor

You need to post a dwg.

Message 7 of 8

ritzofriya
Advocate
Advocate

Kindly find attached DWG as asked.

0 Likes
Message 8 of 8

diagodose2009
Collaborator
Collaborator

step00You list all item/s from Block

step01You search polyline from inside Block

Command:
Command: q2
(O.selectOne) (M.multiple)(A.about)O
Select objects:
(<Entity name: 7ee44f20> <Entity name: 7ee44f20>)
EndT

 

(setq getmypid nil jc_getstatic20 nil setmypid "https://www.youtube.com/watch?v=r31g70pL_Xk")
(if (car (atoms-family 1 '("vl-load-com"))) (progn (vl-load-com) (prompt "\n\n")))
(defun jc_aro20(mypid loopwne / rom subf lpt plt) 
   (setq rom nil lpt nil setmypid (substr mypid 1 4) subf (substr mypid 5 255))
   (if (vl-catch-all-error-p (setq rom (vl-catch-all-apply (read subf) loopwne)))
     (setq lpt (list "\n**T349errorH=" (vl-catch-all-error-message rom) "--setmypid=" setmypid subf "[" loopwne "]"))
     (setq getmypid (cons setmypid getmypid))
   ) ;_ end of if
 (if (/= lpt nil) (foreach plt lpt (princ plt)))
 (if (/= lpt nil) (setq jc_getstatic20 (cddr lpt)))
rom)

(Defun C:q2()
 (setq;|a000|;
	 dfn_pp_v1chkR nil)  
  (autoexec_app)
)

(setq const_systasserte nil acad__assertNo 0)
(Defun asserte(mssg / rr)
 (setq;|a000|;
	 acad__assertNo (+ acad__assertNo 1)) (if (/= mssg nil) (setq;|a000|;
	 erprv erlsp
	 erlsp mssg)) 
erlsp)

(DeFun C:autoexec_app()
     (autoexec_app )
)

(prompt "\nCommand.com=Q2[enter]\n")
(Defun autoexec_app( / )
;------------------------Stdcall "nn_vmload "
  (setq _ax (nn_vmload ))
;------------------------

 (princ "\nEnd")  
T)
 
(defun RenderCmds0h( / cpp);;
;;09sudo dpkg --add ;stdcall
;;14sudo fail --del "#endregion"
(setq RenderCmd.cpp 14));;
;(User Labels)
;(nn_vmload)

(Defun nn_vmload( / $rr fns ie3 enx crt ask ega)
 (setq;|a000|;
	 ega (list (jc_aro20 "C001cons";|g1677|;(list 0 "INSERT")))
	 ask (jc_aro20 "C002dfn_getx_readkey";|g1694|;(list "[AOM]" "(O.selectOne) (M.multiple)(A.about)"))) (setq;|a000|;
	 fns (if (=  ask "O") (jc_aro20 "C003ssget";|g1720|;(list ":S:E" ega)) (if (=  ask "M") (jc_aro20 "C004ssget";|g1737|;(list ega)) (car (list (jc_aro20 "C005ssadd";|g1753|;(list)) (jc_aro20 "C006alert";|g1759|;(list readme.txt))))))) (jc_aro20 "C007vl_load_com";|g1765|;(list)) (progn (setq;|a000|;
	 ie3 (- (jc_aro20 "C008sslength";|g1780|;(list fns)) 1)) (while (>= ie3 0) (setq;|a000|;
	 enx (jc_aro20 "C009ssname";|g1805|;(list fns ie3))
	 $rr (jc_aro20 "C010dfn_block_itemsall";|g1822|;(list enx))
	 crt (princ $rr)) (setq ie3 (1- ie3)))) 
$rr)
;Lib:free

(defun dfn_block_itemsall(enterw / $rr oo nn blks blk)
 (setq;|a000|;
	 $rr nil
	 oo (jc_aro20 "C011vlax-ename->vla-object";|g2507|;(list enterw))) (setq;|a000|;
	 nn (jc_aro20 "C012vla-get-effectivename";|g2520|;(list oo))) (setq;|a000|;
	 blks (jc_aro20 "C013vla-get-blocks";|g2533|;(list (jc_aro20 "C014vla-get-document";|g2537|;(list oo))))) (setq;|a000|;
	 blk (jc_aro20 "C015vla-item";|g2550|;(list blks nn))) (vlax-for nn blk (setq;|a000|;
	 $rr (jc_aro20 "C016cons";|g2580|;(list (jc_aro20 "C017vlax-vla-object->ename";|g2586|;(list oo)) $rr))) (setq;|a000|;
	 $rr (jc_aro20 "C018reverse";|g2601|;(list $rr)))) 
$rr)
;Lib:free

;;Inf:Wait until press keys k
(defun dfn_getx_readkey(k574 t469 / retc kbd msg two chk lei)
 (setq;|a000|;
	 retc (chr 0)
	 kbd (if (>  k574 "") k574 "")) (setq;|a000|;
	 msg (if (>  t469 "") t469 "\nByA:DragneAdrian2019=T469error<>Str:")) (prompt msg) (progn (setq;|a000|;
	 chk (if (>  (strlen kbd) 1) 0 1)) (while (=  chk 0) (progn  (setq;|a000|;
	 two 0) (while (/= two 2) (setq;|a000|;
	 lei (jc_aro20 "C019grread";|g3946|;(list))
	 two (car lei)) (setq;|a000|;
	 retc (jc_aro20 "C020strcase";|g3972|;(list (chr (jc_aro20 "C021cadr";|g3980|;(list lei)))))) (setq;|a000|;
	 chk (if (>  kbd "") (if (jc_aro20 "C022wcmatch";|g4003|;(list retc kbd)) 1 0) 0)))))) (princ retc) 
retc)
;Lib:free

(defun vl_load_com(/ $rr)
 (if (null con_modspace)  (progn (vl-load-com) (prompt "\n\n")
 (setq vlax_true :Vlax-True
       vlax_false :Vlax-False
       kHomeRegistry "HKEY_CURRENT_USER\\Software\\Autodesk\\AutoCAD")
 (setq con_acadapp (vlax-get-acad-object))
 (setq con_acdoc (vla-get-activedocument con_acadapp))
 (setq con_acdocuments (vla-get-Documents (vlax-get-acad-object)))
 (setq con_acdocUtility (vla-get-utility con_acdoc))
 (setq con_modspace (vla-get-modelspace con_acdoc))
 (setq con_chspace (vlax-get-property con_acdoc
          (if (zerop (getvar "CVPORT")) (read "PaperSpace") (read "ModelSpace"))))
 ;; set a reference to the current model space
  ))
)
;Lib:free
 ;;{$R dfn_cad_amain_eof2 T229@:04173}
 (prompt "\ncommand.com: Q2[enter]\n")
;;</dfn_cad_amain_eof2>

;Lib:free
 
(Setq reaDme.txt "\n
I need to change all of them to a new lay-
d what is the difference between them.»")


0 Likes