SaliKatt Posted August 26, 2007 Posted August 26, 2007 Hi, I have several dwg files that have polyline objects that have the following statement when using the list command: "Extrusion direction relative to UCS: X= 0.00 Y= 0.00 Z= -1.00" The elevation is 0 in the line properties. I'm using the dwg file as background in a another software and unfortunately it does not display the lines with the -1 value. I'm using the mirror3d (object) command around itself to do it manually in ACAD, is there any way to find all this polylines using VBA. I have tried to search the properties of polylines but could not find any extrusion directions. Quote
kduck63 Posted August 26, 2007 Posted August 26, 2007 It sounds like you are looking at the line(s) along the axis of the line itself. If you rotate the UCS around the X or Y axis 90 degrees you will see the true length of the line. Quote
SaliKatt Posted August 26, 2007 Author Posted August 26, 2007 Thx for reply, But the change of UCS does not change the result of the list command. And the line apears correctly in ACAD in UCS=world. I have attched an example. -kl Drawing1.dwg Quote
SEANT Posted August 26, 2007 Posted August 26, 2007 Extrusion Direction is the same a Normal. So, if using VBA then: varNormal = entLWPoly.Normal If varNormal(2) = -1 Then etc. If you want to find them from the Autocad screen then a filter set up as shown below will automatically select all polylines with normals not aligned to the positive Z axis. Quote
kduck63 Posted August 26, 2007 Posted August 26, 2007 You can eliminate the z = -1 thing by making a bpoly, region or by UCS, NEW, Object. Quote
SaliKatt Posted August 27, 2007 Author Posted August 27, 2007 seant, Thanks, i didn't know about the filter command. Really nice feature. But I could not use -1 as a filter for the Z value, but I got around it using NOT. The VBA also works to get all relevant objects in the selection set. Now it's just to play around a bit with the mirror3d function (in VBA) to I get it right. Kduk63, Yes, when I played with the UCS i eliminated the z=-1 value, but as the external software is reading WCS it did not really helped. But thanks anyway. For your info the file is actually saved as a dwg by microstation, i think thats why I get the z=-1 value on some of the polylines. I'm in the learning phase of VBA in ACAD so I could need some help with the VBA equal to the mirror3d object (not by point) -kl Quote
SEANT Posted August 27, 2007 Posted August 27, 2007 seant,But I could not use -1 as a filter for the Z value, but I got around it using NOT. I couldn't either. I had to do the same but with != (not equal to). Specific questions about VBA are usually answered quickly by this site's numerous VB gurus. Quote
macchi Posted January 18, 2011 Posted January 18, 2011 (edited) I had to solve this problem in drawings coming from microstation/dgn format. A lot of arcs and polylines had this and couldn't be joined. I solved this problem with a simple Lisp routine. (defun c:swap() (setq f1 (ssget "_x" '((210 0.0 0.0 -1.0)))) (if (/= f1 nil) (command "_mirror3d" f1 "" "xy" "0,0,0" "y") ) (setq f1 nil) ) Marco Edited January 19, 2011 by macchi 1 Quote
John W426 Posted September 5, 2023 Posted September 5, 2023 Thanks macchi! Your Lisp routine fixed mirrored text when importing DXFs into 3rd party CAD software. 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.