new_mem Posted November 17, 2017 Posted November 17, 2017 Hello, Can someone tell me the way change all z of point to 0.0 (attached file) Thanks. new block.dwg Quote
Dadgad Posted November 18, 2017 Posted November 18, 2017 You can do this without a lisp by simply selecting all of the points in Top view, and in Properties set the Z values (which will indicate Varies) to 0.0 Quote
new_mem Posted November 18, 2017 Author Posted November 18, 2017 Thanks for repply. But i mean startpoint or endpoint of ellip in file attached. Sorry for last post not clear Quote
Roy_043 Posted November 18, 2017 Posted November 18, 2017 None of the entities in the dwg are coplanar with the XY plane of the WCS. You can try this: Set the UCS to the WCS (_UCS > _World) and then use the _Flatten command. Quote
new_mem Posted November 18, 2017 Author Posted November 18, 2017 Hi, Flatten done then object run to another location. I mean write code lisp following but ellip not effect: (defun c:test () (setq ss (ssget '((0 . "ARC")))) (setq n 0) (repeat (sslength ss) (setq arc (vlax-ename->vla-object (ssname ss n))) (setq str (vlax-get arc 'StartPoint)) (setq end (vlax-get arc 'EndPoint)) (setq cen (vlax-get arc 'Center)) (setq str_n (list (car str) (cadr str) 0.0)) (setq end_n (list (car end) (cadr end) 0.0)) (setq cen_n (list (car cen) (cadr cen) 0.0)) (command "_ARC" "C" "_none" cen_n "_none" str_n "_none" end_n) (vla-delete arc) (setq n (1+ n)) ) (princ) ) Quote
Roy_043 Posted November 18, 2017 Posted November 18, 2017 Maybe I have misunderstood, but how do you propose to change the Z coordinates of entities without moving them? Notice that the normal of most entities is (0.00684151 -7.95332e-005 0.999977) instead of (0 0 1). So everything is slightly tilted relative to the XY plane of the WCS. Quote
new_mem Posted November 19, 2017 Author Posted November 19, 2017 Thanks Roy I mean convert object to pline (green) in WCS (file attached). Can you tell me do it ? new block.dwg Quote
jamalflash Posted November 20, 2017 Posted November 20, 2017 Hello, Can someone tell me the way change all z of point to 0.0 (attached file) Thanks. the command flatten or the lisp zeroz Quote
new_mem Posted November 20, 2017 Author Posted November 20, 2017 the commandflatten or the lisp zeroz Hi, Zeroz not effec. Flatten then object run miscellaneous. Quote
Roy_043 Posted November 20, 2017 Posted November 20, 2017 Your drawing is very peculiar. Not only are there undesirable 3D effects, the elliptical arcs all seem to have a major and minor radius that is almost equal (in other words: they are virtually circular). With that in mind here is a function, similar to your suggestion, to create arc replacements in the Z=0 plane for both the arcs and the elliptical arcs: (vl-load-com) (defun c:Test ( / enm idx ss) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-endundomark doc) (vla-startundomark doc) (setvar 'cmdecho 0) (if (setq ss (ssget '((0 . "ARC,ELLIPSE")))) (repeat (setq idx (sslength ss)) (setq enm (ssname ss (setq idx (1- idx)))) (if (not (vlax-curve-isclosed enm)) (progn (command "_.arc" "_non" (mapcar '* (vlax-curve-getstartpoint enm) '(1.0 1.0 0.0)) "_non" (mapcar '* (vlax-curve-getpointatdist enm (* 0.5 (vlax-curve-getdistatparam enm (vlax-curve-getendparam enm))) ) '(1.0 1.0 0.0) ) "_non" (mapcar '* (vlax-curve-getendpoint enm) '(1.0 1.0 0.0)) ) (entdel enm) ) ) ) ) (setvar 'cmdecho 1) (vla-endundomark doc) (princ) ) The procedure would be: 1. Switch to the WCS. 2. Substitute all (elliptical) arcs using c:Test. 3. Flatten all polylines. 4. Use the _Join command. 5. Some elements will not join to form closed polylines. This is due to inaccuracies. Quote
new_mem Posted November 20, 2017 Author Posted November 20, 2017 Your drawing is very peculiar. Not only are there undesirable 3D effects, the elliptical arcs all seem to have a major and minor radius that is almost equal (in other words: they are virtually circular). With that in mind here is a function, similar to your suggestion, to create arc replacements in the Z=0 plane for both the arcs and the elliptical arcs: (vl-load-com) (defun c:Test ( / enm idx ss) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-endundomark doc) (vla-startundomark doc) (setvar 'cmdecho 0) (if (setq ss (ssget '((0 . "ARC,ELLIPSE")))) (repeat (setq idx (sslength ss)) (setq enm (ssname ss (setq idx (1- idx)))) (if (not (vlax-curve-isclosed enm)) (progn (command "_.arc" "_non" (mapcar '* (vlax-curve-getstartpoint enm) '(1.0 1.0 0.0)) "_non" (mapcar '* (vlax-curve-getpointatdist enm (* 0.5 (vlax-curve-getdistatparam enm (vlax-curve-getendparam enm))) ) '(1.0 1.0 0.0) ) "_non" (mapcar '* (vlax-curve-getendpoint enm) '(1.0 1.0 0.0)) ) (entdel enm) ) ) ) ) (setvar 'cmdecho 1) (vla-endundomark doc) (princ) ) The procedure would be: 1. Switch to the WCS. 2. Substitute all (elliptical) arcs using c:Test. 3. Flatten all polylines. 4. Use the _Join command. 5. Some elements will not join to form closed polylines. This is due to inaccuracies. Yep, that is what i said. Thank you very much Roy. But in my test drawing the ellip RED error. Why ? Quote
Roy_043 Posted November 21, 2017 Posted November 21, 2017 What do you mean by 'error'? In my test the procedure I have outlined works fine on that shape: the result is a closed polyline. Quote
new_mem Posted November 21, 2017 Author Posted November 21, 2017 What do you mean by 'error'? In my test the procedure I have outlined works fine on that shape: the result is a closed polyline. Hi Roy This ellip color red still error. new block.dwg Quote
Roy_043 Posted November 21, 2017 Posted November 21, 2017 In BricsCAD this ellipse is replaced successfully. My guess is that the huge coordinates and the very small difference between the StartAngle and EndAngle are causing a problem in AutoCAD: The arc is almost a straight line. You can try improving the c:Test function to account for this specific case. The BIG question is of course who or what process produced this cr*ppy drawing? Quote
Grrr Posted November 21, 2017 Posted November 21, 2017 Heres a similar thread located in the 'Application Archive' section: http://www.cadtutor.net/forum/showthread.php?2019-Flatten But I guess is for WCS only. Quote
new_mem Posted November 22, 2017 Author Posted November 22, 2017 In BricsCAD this ellipse is replaced successfully. My guess is that the huge coordinates and the very small difference between the StartAngle and EndAngle are causing a problem in AutoCAD: The arc is almost a straight line. You can try improving the c:Test function to account for this specific case. The BIG question is of course who or what process produced this cr*ppy drawing? Thanks for suggestion, Roy. This drawing following from consultant. Crazy! Xr-Pool.dwg Quote
new_mem Posted November 22, 2017 Author Posted November 22, 2017 Heres a similar thread located in the 'Application Archive' section:http://www.cadtutor.net/forum/showthread.php?2019-Flatten But I guess is for WCS only. Thanks Grrr, but it still not work for drawing. 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.