stevo99 Posted May 21, 2015 Share Posted May 21, 2015 Hi All, I am trying to write my first lisp to draw a basic portal frame. I have used excel to work out the coordinates and construct a command which once I get the drawing command working, I will then do the background math in lisp. For now though, I have the following command that doesn't seem to work and I can't see why. (command "pline" (getpoint "\nPick Base Point: ") "@0,7630" "@14143.5,1237.4" "@14143.5,-1237.4" "@0,-7630" "@530,0" "@0,8208.4" "@-14673.5,1769.4" "@-14673.5,-1769.4") It draws a pline as desired but for some reason the "@530,0" point is placed over the previous one and the pline draws over itself. Any ideas? Also when i paste the command from excel it executes straight away and gives me error messages: Command: (command "pline" (getpoint "\nPick Base Point: ") "@0,7630" "@14143.5,1237.4" "@14143.5,-1237.4" "@0,-7630" "@530,0" "@0,8208.4" "@-14673.5,1769.4" "@-14673.5,-1769.4") Pick Base Point: Unknown command "@0,7630". Press F1 for help. Unknown command "5,1237.4". Press F1 for help. Unknown command "5,-1237.4". Press F1 for help. Unknown command "@0,-7630". Press F1 for help. Unknown command "@530,0". Press F1 for help. Unknown command "4". Press F1 for help. Unknown command "5,1769.4". Press F1 for help. Unknown command "5,-1769.4". Press F1 for help. nil Any help is greatly appreciated Quote Link to comment Share on other sites More sharing options...
BlackBox Posted May 21, 2015 Share Posted May 21, 2015 Hi All, I am trying to write my first lisp to draw a basic portal frame. I have used excel to work out the coordinates and construct a command which once I get the drawing command working, I will then do the background math in lisp. For now though, I have the following command that doesn't seem to work and I can't see why. (command "pline" (getpoint "\nPick Base Point: ") "@0,7630" "@14143.5,1237.4" "@14143.5,-1237.4" "@0,-7630" "@530,0" "@0,8208.4" "@-14673.5,1769.4" "@-14673.5,-1769.4") It draws a pline as desired but for some reason the "@530,0" point is placed over the previous one and the pline draws over itself. Any ideas? Unless I've overlooked something, give this a try: (defun c:FOO (/ pt) (if (setq pt (getpoint "\nPick Base Point: ")) (command "pline" pt "@0,7630" "@14143.5,1237.4" "@14143.5,-1237.4" "@0,-7630" "@530,0" "@0,8208.4" "@-14673.5,1769.4" "@-14673.5,-1769.4" [color="red"]"@0,-8208.4" "@530,0" "_c"[/color] ) ) (princ) ) Cheers Quote Link to comment Share on other sites More sharing options...
stevo99 Posted May 21, 2015 Author Share Posted May 21, 2015 Thanks BlackBox, thanks for pointing out my math errors too that still doesn't work though, it's the first "@530,0" coordinate that just doesn't seem to draw properly. See the screenshot below. essentially I get the inside shape just fine, but where I've circled it just seems to reverse back over itself. If I manually enter the pline command and type in the coordinates it works just fine, just not in this lisp.... Quote Link to comment Share on other sites More sharing options...
stevo99 Posted May 21, 2015 Author Share Posted May 21, 2015 Ahhhhh, Nailed it. It is my "Dynamic input" screwing it up. If I turn that off, it works fine. I also stuffed up the top apex height too.... Do you know why the command doesn't work when I paste from excel though in part 2 of my question?? Thanks for the help. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 22, 2015 Share Posted May 22, 2015 I would take a different tack and use the Polar function to work out the points, starting with length, height, pitch this way no worry about pt co-ords. Just a side note there is lots of stuff out there for drawing structural details like a portal including full connection details etc do a bit of a google. Quote Link to comment Share on other sites More sharing options...
stevo99 Posted May 22, 2015 Author Share Posted May 22, 2015 I would take a different tack and use the Polar function to work out the points, starting with length, height, pitch this way no worry about pt co-ords. Just a side note there is lots of stuff out there for drawing structural details like a portal including full connection details etc do a bit of a google. Actually now that you mention it polar would be way easier. My goal here wasn't so much to draw a portal frame but to experiment with lisp to draw something that required a bit of math within the script. I've never written lisp before so figured i'd use it to draw something I draw all the time. I've been resisting the urge to poke around looking for ready made scripts as I wouldn't be learning lisp then. Cheers Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 23, 2015 Share Posted May 23, 2015 Have a look at Strucplus its Aussie product, will do what you want fully detailed in a few seconds. Another wisesteelshapes. 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.