easier way to flip arc normal

easier way to flip arc normal

GilesPhillips
Collaborator Collaborator
2,577 Views
17 Replies
Message 1 of 18

easier way to flip arc normal

GilesPhillips
Collaborator
Collaborator

It turns out that whilst the exportlayout command is great, its output frequently produces arcs with a normal that is inverted (i.e. normal Z is -1).  this makes it impossible to join these arcs into polylines without flipping (though they will join into splines).  I currently do this by moving the view into an isometric and using 3d rotate about the x or y axis then reposition if necessary.

 

This is a bit of a chore.  is there a better way of doing it?

 

I guess if the Autodesk developers team feel like fixing this 'feature' that would be great too 🙂

 

(Running fully up to date Acad 2023)


G

ACad, MEP, Revit, 3DS Max
2,578 Views
17 Replies
Replies (17)
Message 2 of 18

ВeekeeCZ
Consultant
Consultant

Are they flat? If so, you can select them all and use FLATTEN to flip them.

Message 3 of 18

GilesPhillips
Collaborator
Collaborator

yep, they're flat and coplanar with all other elements.

 

I can also successfully join into polylines if I flip the ucs 180deg about the x or y axis. however I'd prefer to avoid this as these files are exported to 3rd party software which may not react favourably to a 'back to front' polyline.

ACad, MEP, Revit, 3DS Max
Message 4 of 18

ВeekeeCZ
Consultant
Consultant

OK, then again, try to use the FLATTEN.

Message 5 of 18

GilesPhillips
Collaborator
Collaborator

flatten makes no difference 😞

ACad, MEP, Revit, 3DS Max
0 Likes
Message 6 of 18

ВeekeeCZ
Consultant
Consultant

Well, then I misunderstood how it's flipped. Would you post a dwg sample of one of those?

0 Likes
Message 7 of 18

SEANT61
Advisor
Advisor

Mirror3d is pretty easy.  

 

Command: LIST

Select objects: 1 found

Select objects:

                  ARC       Layer: "0"
                            Space: Model space
                   Handle = 1ee
            center point, X=  10.9360  Y=   4.0019  Z=   0.0000
            radius    0.6121
Extrusion direction relative to UCS:
                   X=   0.0000  Y=   0.0000  Z=  -1.0000
            length    1.6748
             total angle    157

Command: MIRROR3D

Select objects: 1 found

Select objects:

Specify first point of mirror plane (3 points) or
[Object/Last/Zaxis/View/XY/YZ/ZX/3points] <3points>: xy
Specify point on XY plane <0,0,0>:

Delete source objects? [Yes/No] <N>: y

Command: LIST

Select objects: 1 found

Select objects:

                  ARC       Layer: "0"
                            Space: Model space
                   Handle = 1ee
            center point, X=  10.9360  Y=   4.0019  Z=   0.0000
            radius    0.6121
             start angle    309
               end angle    106
            length    1.6748

************************************************************
May your cursor always snap to the location intended.
Message 8 of 18

GilesPhillips
Collaborator
Collaborator

Attached are 2 files. (I've deleted some irrelevant detail) 

in the 2d file you'll need to explode the blocks first, then you'l l see each and every arc appears to have its normal flipped.  I want to join these segments to adjoining lines to present a series of closed polylines for our fabricators to cut on their CNC cutters.   I've had plenty of grumbling in the past about anomalous entities in CAD files upsetting the software, so I try to present them with files as simple as possible with all blocks exploded, closed polylines, etc..

 

The file is produced from using the exportlayout command on a file (attached, called 3d) with 3d views of autocad native solids.

ACad, MEP, Revit, 3DS Max
0 Likes
Message 9 of 18

GilesPhillips
Collaborator
Collaborator

ooh, mirror3d, that looks cool will try that for the interim.

 

bonus points figuring out a way to stop the arcs being inverted in the first place 🙂

ACad, MEP, Revit, 3DS Max
0 Likes
Message 10 of 18

ВeekeeCZ
Consultant
Consultant

Must be missing something. FLATTEN works flawlessly. 

I can either select all blocks, flatten, explode. Or Explode, select all arcs, flatten.

Both workflows result in arcs with +1 Z.

0 Likes
Message 11 of 18

GilesPhillips
Collaborator
Collaborator

How odd.

I'm going to have to review the differences in the source files again perhaps because it definitely wasn't doing it yesterday..

 

oh well - many thanks for your input on this.

ACad, MEP, Revit, 3DS Max
0 Likes
Message 12 of 18

SEANT61
Advisor
Advisor

Indeed, flatten does work here as well. 

Leave "Remove hidden lines? <No>:" as no.


************************************************************
May your cursor always snap to the location intended.
0 Likes
Message 13 of 18

GilesPhillips
Collaborator
Collaborator
Maybe that was the bit I did wrong..
ACad, MEP, Revit, 3DS Max
0 Likes
Message 14 of 18

Kent1Cooper
Consultant
Consultant

@ВeekeeCZ wrote:

.... FLATTEN works flawlessly.  ....


... except that it moves those Arcs that are not a Z=0 in elevation to there.  Surely that is not wanted.

Kent Cooper, AIA
0 Likes
Message 15 of 18

Kent1Cooper
Consultant
Consultant

@GilesPhillips wrote:

.... arcs with a normal that is inverted (i.e. normal Z is -1).  .... impossible to join these arcs into polylines without flipping....


How about this?  It checks each Arc among the selection for a Z coordinate of its extrusion direction of -1, and if that's the value, it spins it around 180° about the axis from its center to its midpoint, preserving non-zero elevations.  [lightly tested]

 

(vl-load-com)
(defun C:ANDU ; = Arc Normal Down to Up
  (/ ss n arc)
  (if (setq ss (ssget '((0 . "ARC"))))
    (repeat (setq n (sslength ss)); then
      (setq arc (ssname ss (setq n (1- n))))
      (if (equal (cadddr (assoc 210 (entget arc))) -1.0 1e-2); downward normal?
        (command ; then
          "_.ucs" "_zaxis"
          "_non" (getpropertyvalue arc "Center")
          "_non" (vlax-curve-getPointAtDist arc (/ (getpropertyvalue arc "Length") 2))
          "_.rotate" arc "" "_non" "0,0" "180"
          "_.ucs" "_previous"
        ); command
      ); if
    ); repeat
  ); if
  (prin1)
)
Kent Cooper, AIA
Message 16 of 18

RobDraw
Mentor
Mentor

@GilesPhillips wrote:

It turns out that whilst the exportlayout command is great, its output frequently produces arcs with a normal that is inverted (i.e. normal Z is -1).  this makes it impossible to join these arcs into polylines without flipping (though they will join into splines).


Maybe a different way of exporting will prevent this from happening.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes
Message 17 of 18

GilesPhillips
Collaborator
Collaborator

Possibly, however the exportlayout is a great way of quickly getting flat geometry from occasionally complex 3d geometry that's already been arranged in paperspace using 3d views.  Flatshot is okay for 'raw' geometry, but not so much for curated geometry with context.  As I'm creating the paperspace layout for other purposes, it makes sense to use exportlayout to generate my 2d stuff.

ACad, MEP, Revit, 3DS Max
0 Likes
Message 18 of 18

RobDraw
Mentor
Mentor

@GilesPhillips wrote:

it makes sense to use exportlayout to generate my 2d stuff.


Until the output is undesirable. Exploring other options may reveal a better solution. Just saying.


Rob

Drafting is a breeze and Revit doesn't always work the way you think it should.
0 Likes