Search the Community
Showing results for tags 'user break'.
Found 1 result
insert block at distance & angle from first block, then repeat until stopped
BudPerry posted a topic in AutoLISP, Visual LISP & DCLIn this portion of a continuing program I'm putting together, a 4' block is inserted at a user point at a defined angle, then it is again inserted but this time 4' away at the same angle so that the two blocks form an 8' line. This is continued until the user stops the program. However, when the second block is inserted, it is rotated correctly but inserted somewhere north of where it is supposed to be. Obviously my polar calc or something is off: (defun c:blockinsert () ; ; ; ;part 5 of overall program ; ; (setq p1 (getpoint "\nSELECT POINT: "));user inputs first point (setq p2 (getpoint "\nSELECT NEXT POINT: "));user inputs second point - for use in part 6 of program ; (setq ang1 (angle p1 p2));get angle from user points (setq angreal (* 180.0 (/ ang1 pi)));convert from radians to degrees ; (setq blockpt "@48<");create a string that puts the next block at 48 inches away at same angle - from first point ; (command "_insert" "I:/documents/pog-panel-4" P1 "1" "1" angreal "1" "category text" "lf");first insertion at first point with two attributes filled ; (setq nextpoint (polar p1 angreal 48));add 4' from p1 at same angle (setq nextp (strcat blockpt angreal));this line is wrong, but I can't figure out how to get the info into the command line... ; (command "_insert" "I:/documents/pog-panel-4" nextp "1" "1" angreal "1" "category text" texttwo) ;insert 4' from last one ; ; ;now I need to add a line that will increase the amount from 4' to 8', ;then to 12', and so on in multiples of 4' - the block is 4' long ;until the user hits escape to stop the block insertions ;maybe use the repeat function? ; );end defun Any ideas on how to correct the insertion and how to create the repeat function and user break?