progeCAD support, tips and troubleshooting forum. progeCAD works very similar to some versions of AutoCAD. Moderated.

Moderators: caddit, Moderators

#1477 by Dong Weng
Fri Mar 25, 2011 8:49 am
"*" is used to repeat routine in short macro for a new toolbar, see example below:
*^C^C_break mid \@ ,you only need to pick the object to break on and on
it seams * does nothing in Progecad,the toolbar icon must be pressed each time to repeat the routine, how can i alter the macro to make repeat endless?
#1482 by caddit
Wed Mar 30, 2011 2:28 pm
Hi Dong Weng,


There are several factors to consider here -

1) The macro that you wish to use (^C^C_break _mid \@) is not applicable - in progeCAD it isn't possible, in the _break command, to run an esnap mode;
2) To run multiple times the same progeCAD command (this works the same way for any of the progeCAD commands) you must use the MULTIPLE command (for details see the on-line progeCAD help), which enables the auto-repeat. Unfortunately, the MULTIPLE function does not perform a complex menu macro but allows only the repetition of a single command without parameters being specified.

The only solution that can allow you to obtain the required behavior is to write a Lisp script or a VBA procedure that would do that. For example, here is a small Lisp script (which you can insert inside a button) that allows the breaking of N consecutive lines in their midpoint:
(while t (setvar "OSMODE" 2)(setq pt (getpoint "\nSelect Line"))(command "_break" pt pt) )

Warning: to get a perfect behavior it will be necessary to extend this script, the way it is reported here reset the esnap mode each time it runs.
#1489 by Dong Weng
Mon Apr 25, 2011 10:32 pm
when run a short lisp routine as below, if cursor pick out side of an object the routine will stop as expected, after press Esc back to command line the esnap will not work no matter if you change the Osmode or manualy change the esnap setting on tool bar none of the object snap setting is working, please advise.
The purpose of the following routine is to break an object with a gap.

(defun c:midbridge()
(if (not bw_def)
(progn
(initget 6)
(setq bw(getreal "\nEnter bridge width[ROUTER NICK-1.8/LASER NICK-0.9] <5>:"))
(if (not bw) (setq bw 5))
)
(progn
(setq bw (getreal (strcat "\nEnter bridge width[ROUTER NICK-1.8/LASER NICK-0.9]<" (rtos bw_def) ">:")))
)
)
(if (not bw) (setq bw bw_def))
(setq bw_def bw)
(while t
(setvar "OSMODE" 514)
(setq pn (getpoint "\nSelect Object"))
(command "circle" pn "d" bw "zoom" "O" "L" "" "regen" "trim" "l" "" pn "" "erase" "previous" "" "zoom" "p" )
);end of while
);end of midbridge :?:
#1497 by caddit
Fri May 06, 2011 1:44 am
Hello Dong Weng,


We have taken some time to modify your script. Please try this and advise if it works as required:

Code: Select all(defun c:midbridge()
(if (not bw_def)
(progn
(initget 6)
(setq bw(getreal "\nEnter bridge width[ROUTER NICK-1.8/LASER NICK-0.9] <5>:"))
(if (not bw) (setq bw 5))
)
(progn
(setq bw (getreal (strcat "\nEnter bridge width[ROUTER NICK-1.8/LASER NICK-0.9]<"
(rtos bw_def) ">:")))
)
)
(if (not bw) (setq bw bw_def))
(setq bw_def bw)
(setq e t)
(while e
  (setvar "OSMODE" 514)
  (setq e ( ENTSEL "\nSelect Object" ))
  (if e
    (progn
      (setq pn (nth 1 e ))
      (setq ent (car e))
      (command "_circle" pn "_d" bw ) ;"_zoom" "_O" "_L" "" "_regen")
      (setq circleEnt (entlast))
      (command "_trim" "_l" "" pn "" "_erase" circleEnt "" );"_zoom" "_p" )
    )
  )
  );end of while
);end of midbridge

#1498 by Dong Weng
Fri May 06, 2011 10:15 am
Thank you for reply, but my initial problem is if you accidentally didn't pick on the object while run the script, the object snap setting will loss function,even if you start a new drawing,you have to save the drawing and restart the program to gain the snap setting . I have tried the code you have modified and the problem still remained.