leonucadomi Posted February 8, 2023 Share Posted February 8, 2023 hello all: I have a routine that moves objects to z0. .. is perfect but I would like a routine that warns me that the drawing has elements in a different position than z0. I mean run it, and tell me that there are such a number of different elements in z0. anybody can i help me? thanks Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 8, 2023 Share Posted February 8, 2023 You should know by now how to do a ssget say line,arc, circle,pline and depending on object, then look at each entity property checking Z value. For a big dwg may not be fast. 1 Quote Link to comment Share on other sites More sharing options...
leonucadomi Posted February 8, 2023 Author Share Posted February 8, 2023 the drawings that I handle are not greater than 1mb, normally they should be flat , but I was surprised that there are elements in a different position than z0 maybe someone has something that can help me detect them. Quote Link to comment Share on other sites More sharing options...
mhupp Posted February 8, 2023 Share Posted February 8, 2023 Change view front? Everything should be on one line if they are on the same elevation. (defun C:FrontView () (command-s "-vpoint" "0,-1,0") ) 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 8, 2023 Share Posted February 8, 2023 A quicky -VPOINT 0,-1,0 a quick zoom should show /= 0 1 Quote Link to comment Share on other sites More sharing options...
wkplan Posted February 9, 2023 Share Posted February 9, 2023 Hi, I would prefer two steps: 1) check, if there is something on z/=0 Use systemvariables EXTMIN and EXTMAX, both tell you the hightest/lowest x,y,z Could also be used to see, if there are objects outside the defined drawing area 2) if any of extmin or extmax tells you, there is something with z/=0, check the bounding-boxes : (defun c:test (/ j k minp maxp) (vl-load-com) (vlax-for obj (vla-get-blocks ; <-- only checks block-definitions (vla-get-activedocument (vlax-get-acad-object)) ) ;_ end of vla-get-blocks (setq bbox (vl-catch-all-apply 'vla-getboundingbox (list obj 'j 'k)) ) ;_ end of setq (if (vl-catch-all-error-p bbox) () (progn (setq zminp (caddr (vlax-safearray->list j))) (setq zmaxp (caddr (vlax-safearray->list k))) (if (OR (< zminp -1) (> zmaxp 1)) (princ (strcat "\nObject: " (if (vl-catch-all-apply 'vla-get-effectivename (list obj)) (vla-get-effectivename obj) (vla-get-name obj) ) ;_ end of if " Z-min: " (rtos zminp) " Z-max: " (rtos zmaxp) ) ;_ end of strcat ) ;_ end of princ ) ;_ end of if ) ;_ end of progn ) ;_ end of if ) ;_ end of vlax-for ) ;_ end of defun (c:test) regards Wolfgang 1 Quote Link to comment Share on other sites More sharing options...
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.