PDA

View Full Version : Extrusion Direction z= -1 on Polylines



SaliKatt
26th Aug 2007, 12:24 pm
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.

kduck63
26th Aug 2007, 02:40 pm
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.

SaliKatt
26th Aug 2007, 03:49 pm
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

SEANT
26th Aug 2007, 04:32 pm
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.

kduck63
26th Aug 2007, 06:46 pm
You can eliminate the z = -1 thing by making a bpoly, region or by UCS, NEW, Object.

SaliKatt
27th Aug 2007, 07:14 am
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

SEANT
27th Aug 2007, 10:29 am
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.

macchi
18th Jan 2011, 08:26 pm
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.:shock:

(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