Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Octagon macro

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
dpierson6B4ETP
373 Views, 7 Replies

Octagon macro

Beginner here and I've searched the internet until I was blue in the face for an answer to a seemingly straightforward problem. As part of an assignment, I need to make a macro that creates an octagon with edges that measure 8 units in length. Every time I use this macro:

 

^C^C_polygon;8;e;\;8<90;

 

I get an "invalid 2d point. Specify second endpoint of edge" error and need to manually enter "8" tab "90" or drag the cursor 8 units straight up to form the octagon. The macro registers the number of side I want and allows me to select the fist endpoint of the edge...then fails.

 

I'd appreciate any concrete. non-cryptic, help.

 

I have tried dozens of permutations (including -polygon) of the macro above and nothing gets me past the error

7 REPLIES 7
Message 2 of 8
ВeekeeCZ
in reply to: dpierson6B4ETP

Try this?

 

^C^C_polygon;8;e;\@8<90;

Message 3 of 8

The @ is the key, needed for a relative displacement.  Also, the \ for user input is complete by itself -- the ; after it is extraneous.  And the ; at the very end is not needed -- Enter is assumed at the end unless the macro ends with a control character of some kind.

Another way:

^C^C_polygon;8;e;\@0,8

Kent Cooper, AIA
Message 4 of 8

Here is a Lisp.

 

(defun c:OCTA (/ side angle radian step x y points)

(setq pt1 (getpoint "\nSelect point"))  

(command "_polygon" "8" "E" pt1 "@8<90")


  (princ)
)

 

 

 

Vincent Sheehan

Sr. Civil Designer
Poly In 3D Blog

Message 5 of 8
pendean
in reply to: dpierson6B4ETP

@dpierson6B4ETP It appears you may not familiar with these for deliberate placement (see highlighted section)

https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-683349C0-E5C2-4E16-8846-5523E71172A9#:~:text=... 

pendean_0-1706883643720.png

 

 

Happy coding!

 

Message 6 of 8
ВeekeeCZ
in reply to: dpierson6B4ETP

Just a dynamic input user who does not know, that it's not all relative by default.

Message 7 of 8
dpierson6B4ETP
in reply to: ВeekeeCZ

Thank you!  I was *this* close...I could have sworn I tried that.  

Message 8 of 8

You guys are the best!  Thank you...I almost threw my laptop out the window!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report