Jump to content

Recommended Posts

Posted

Hi guys,

I was wondering is it possible to increase the size of this pickbox, when the user is prompted for an entsel ?

entsel box.jpg

I tried using the cursorsize variable, but it isn't helping.

Posted

You answered your own question, the variable is "pickbox". :)

Posted
  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

Posted
  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.

Posted

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: "))

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...