Grrr Posted August 1, 2016 Posted August 1, 2016 Hi guys, I was wondering is it possible to increase the size of this pickbox, when the user is prompted for an entsel ? I tried using the cursorsize variable, but it isn't helping. Quote
a_67vdub Posted August 1, 2016 Posted August 1, 2016 You answered your own question, the variable is "pickbox". Quote
Grrr Posted August 2, 2016 Author Posted August 2, 2016 a_67vdub said: You answered your own question, the variable is "pickbox". Thanks dude! Now my question seems kinda ironic, but heres the final result of the code I was working on: ; VLD_Offset ; Perform offset, by detecting with cursor, from which side the entity is selected, ; and then the entity is offseted, corresponding to that side/orientation. (defun C:test ( / *error* oldcmd oldclp oldpxsz off-dist ent vla-obj P-pt C-pt T-pt ) (vl-load-com) (defun *error* ( msg ) (if oldcmd (setvar 'cmdecho oldcmd)) (if oldclp (setvar 'clipromptlines oldclp)) (if oldpxsz (setvar 'pickbox oldpxsz)) (if (not (member msg '("Function cancelled" "quit / exit abort"))) (princ (strcat "\nError: " msg)) ) (princ) ) (initget 1) (if (setq off-dist (getreal "\nSpecify offset distance: ")) (progn (setvar 'errno 0) (setq oldcmd (getvar 'cmdecho)) (setvar 'cmdecho 0) (setq oldclp (getvar 'clipromptlines)) (setvar 'clipromptlines 1) (setq oldpxsz (getvar 'pickbox)) ; default value is 3 (setvar 'pickbox (* oldpxsz 3)) (while T (while (not (and (setq ent (entsel "\nPick an entity to offset: ")) (member (cdr (assoc 0 (entget (car ent)))) (list "LINE" "LWPOLYLINE" "SPLINE" "CIRCLE" "ARC" "XLINE" "RAY")) ) ) (if (or (= (getvar 'errno) 7) (null (car ent))) (princ "\nYou missed, try again!") ) ); while (progn (setq vla-obj (vlax-ename->vla-object (car ent))) (setq P-pt (cadr ent)) ; pick point (setq C-pt (vlax-curve-getClosestPointTo vla-obj P-pt)) ; closest point (setq T-pt (polar C-pt (angle C-pt P-pt) off-dist)) ; trough point (vl-cmdf "_.OFFSET" "T" ent T-pt "E") ) ); while T ); progn ); if off-dist (princ) ); defun Quote
Lee Mac Posted August 2, 2016 Posted August 2, 2016 Grrr said: (while T < ... > ) This is bad practice as the user is forced to exit the loop by crashing the program (using Esc); consider testing whether the user has dismissed the selection prompt and use this criteria as a test expression for your while loop. Note that the progn expression is also not required, as while will accept multiple expression arguments following the test expression argument. Quote
BIGAL Posted August 3, 2016 Posted August 3, 2016 A example of what I use, ent will return false (alert "pick objects select a blank area to exit") (while (setq ent (entsel "\nPick an entity to offset: ")) Quote
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.