broncos15 Posted October 19, 2015 Share Posted October 19, 2015 I am having an issue with the dimaligned portion of the code. The code runs correctly, but then it gives an error "Unknown command "Dimaligned2"". It seems weird that I am getting the error, but the code still runs. The other issue is that the perpendicular snap is acting really funky (doesn't do it directly across from the place I snapped to). Code is as follows: (defun C:DIMALIGNED2 ( / pt1 pt2 oldsnap) (setq oldsnap (getvar "osmode")) (setq pt1 (getpoint "\nSpecify first extension line origin: ")) (setvar "osmode" 128) (setq pt2 (getpoint "\nSpecify second extension line origin: ")) (command "._DIMALIGNED" pt1 pt2 pause "") (prompt "\nDimension Aligned") (setvar "osmode" oldsnap) (princ) ) Quote Link to comment Share on other sites More sharing options...
broncos15 Posted October 20, 2015 Author Share Posted October 20, 2015 So after looking at it more closely, I know the issue with the perpendicular portion has to do with the fact that the point 2 isn't associated with point 1, so AutoCAD doesn't know what to do it perpendicular from. I tried to correct it doing the following, but it isn't working. (defun C:DIMALIGNED2 ( / pt1 oldsnap) (setq oldsnap (getvar "osmode")) (setq pt1 (getpoint "\nSpecify first extension line origin: ")) (setvar "osmode" 128) (command "._DIMALIGNED" pt1 pause "") (prompt "\nDimension Aligned") (setvar "osmode" oldsnap) (princ) ) Quote Link to comment Share on other sites More sharing options...
broncos15 Posted October 20, 2015 Author Share Posted October 20, 2015 So after realizing I made a dumb mistake in the last post, I made the corrections. However, I am still having issues where it says the command is unknown after running it, it won't reset my osnaps, and perpendicular is working better, but still giving some issues. (defun C:DIMALIGNED2 ( / pt1 oldsnap) (setq oldsnap (getvar "osmode")) (setq pt1 (getpoint "\nSpecify first extension line origin: ")) (setvar "osmode" 128) (command "._DIMALIGNED" pt1 pause pause pause "") (prompt "\nDimension Aligned") (setvar "osmode" oldsnap) (princ) ) Quote Link to comment Share on other sites More sharing options...
broncos15 Posted October 20, 2015 Author Share Posted October 20, 2015 So I came up with a solution in case anyone wants it. I was just making the code more complex than it needed to be. (defun c:dimaligned2 () (command "._dimaligned" pause "_perp" pause pause pause "_e") ) Quote Link to comment Share on other sites More sharing options...
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.