Jump to content

How to change "Normal Z" of a circle?


Recommended Posts

I want to change the property of a circle which has normal Z = -1. I want to change it to normal Z=1.

Please don't get confused between Z coordinate and Normal Z. Normal XYZ has to do something about mirroring object or 3d,there is very less information about it. I tired using UCS to World but didn't help. I elevated my drawing to Z=0 but wont help. Please refer to attached drawing.

103.dxf

Link to comment
Share on other sites

I'm not understanding the question and I'm not exactly sure what you're attempting to do? Why are you concerned with Normals in a 2D drawing?

 

With 3D objects, the Normal is an imaginary ray that is perpendicular to the plane of the the objects surface. So, if you have a flat surface that is sitting on the XY plane, it's Normal will be pointing straight up in the positive Z direction. It makes no difference if the surface is sitting at Z-1.0 or Z1.0, the normal is still pointing up in the positive Z direction.

 

The direction of the Normal will depend on which way the surface is facing. If you rotate the surface 45 degrees along the X or Y axis, then the surface normal will be pointing in that direction, or if you rotate the surface 180 degrees, the Normal will now be pointing in the negative Z direction, but this really only applies to 3D objects. The Normal of a 2D circle will look and behave the same regardless of which direction it is facing.

 

Can you provide more information about what you're trying to do with your drawing?

Normals.jpg

Link to comment
Share on other sites

The easiest would be just redraw the circles but if you really want to get the 'normals' back to normal then first change the UCS to 'front' and then mirror the circles using the centres of the two outer circles for the ends of the mirror line, this just flips them about their axis, but it corrects the normal. 

This does have an affect when you are bringing dxf files into some CNC programs, even 2D has a normal which is present for most cad geometry and is dependant on the UCS that was used at the time of creation and really shows up if you change to an isometric view and give all the items a thickness in the properties palette the 'normal' drives the direction of thickening and when you try and set a cut depth for some CNC machines this obviously sends the cutting tool the wrong way.

Link to comment
Share on other sites

1 hour ago, steven-g said:

This does have an affect when you are bringing dxf files into some CNC programs, even 2D has a normal which is present for most cad geometry and is dependant on the UCS that was used at the time of creation and really shows up if you change to an isometric view and give all the items a thickness in the properties palette the 'normal' drives the direction of thickening and when you try and set a cut depth for some CNC machines this obviously sends the cutting tool the wrong way.

 

This is where more information is very important. I couldn't understand why the OP was concerned with normals for a 2D drawing, but if it's for CNC machining, then ok, that makes more sense.

Link to comment
Share on other sites

An example of changing normal no idea if it helps 

 

(setq obj (vlax-ename->vla-object (car (entsel "pick object "))))
pick object #<VLA-OBJECT IAcadCircle 00000000364B0C50>
(vla-put-normal obj (list 0.0 0.0 1.0))

 

Link to comment
Share on other sites

1 hour ago, BIGAL said:

An example of changing normal no idea if it helps

 

 

I tried your code but the circle normal is still -1.0.

 

The code below works but you can only select one circle at a time and specify the center point as the base point for rotation. So you would have to run it on each circle individually. I only know how to write simple code based on command line input. I'm not good enough with programming to know how to make it select and flip all circles in the drawing automatically. But for only 6 circles, this would work fine and would be faster than stepping through the standard ROTATE3D command.

 

(command "rotate3d" pause "" "x" pause "180")

Link to comment
Share on other sites

Cad64 the plot thickens, if you run the 2 lines in Briscad the normal is changed, in Autocad its not.

 

Lee-mac has provided a solution to this also in another forum using a entmod.

Link to comment
Share on other sites

23 minutes ago, lrm said:

Another approach is to use rotate3d to rotate the circle about the x-axis and the circle's center point by 180°.

 

Yes, that's what my previous post was about. The code I posted uses the Rotate3d command. It just shortcuts some of the keyboard entry.

Link to comment
Share on other sites

Had a couple of minutes

 

(defun c:flipnormal ( / ss ent cen norm)
(setq ss (ssget "x" (list (cons 0 "Circle"))))
(repeat (setq x (sslength ss))
(setq ent (ssname ss (setq x (- x 1))))
(setq norm (nth 3 (assoc 210 (entget ent))))
(setq cen (cdr (assoc 10 (entget ent))))
(if (= norm -1.0)
(command "rotate3d" ent "" "x" cen "180")
(princ "\nNo flip")
)
)
)
(c:flipnormal)

 

Link to comment
Share on other sites

This command macro is setup to re-Normalize circles, arc, and polylines.  There may even be an additional entity or two that could be included.

Sadly, though, I don't think it will work in AutoCAD LT - as it may not have the SSX command.  

One caution is that entities with elevations off of the WCS XY plane will be moved up or down via the Mirror3d command. 

 

SSX;;E;CIRCLE,ARC,LWPOLYLINE;V;0,0,-1;;Mirror3d;p;;xy;;y;

 

I've added entities to the file attached to the OP.

103Modified.dxf

Edited by SEANT
Link to comment
Share on other sites

  • 3 months later...

Hi Guys,

 

I was trying to change the Normal Z -1 to +1 in files with a bunch or ARCS with this issue.

 

I tried your options but it didn't work (lack of LISP knowledge probably)

 

However I was able to convert all my arcs with a simple command MIRROR3D, selecting all the Arcs, running the command using the option Object and that's it

 

It should be easy to create a Script or LISP code to do that to all the Arcs, Circles, etc...

 

It worked in C3D as AutocAD 2019 in a 2D drawing

 

BTW I needed because my survey controllers don't like the Normal Z -1

 

Gregor Samsa

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...