vivekgrs Posted November 9, 2009 Share Posted November 9, 2009 hi everybody, I need to write a code for display the horizontal and vertical distance dynamically. while the user pick the start point and move the mouse. can anyone help me how to proceed. Thanks Vivek Quote Link to comment Share on other sites More sharing options...
gile Posted November 9, 2009 Share Posted November 9, 2009 Hi, Setting DYNMODE and DYNPIFORMAT to 1 ? Quote Link to comment Share on other sites More sharing options...
vivekgrs Posted November 9, 2009 Author Share Posted November 9, 2009 hi gile, Thanks for ur immediate response. i had tried dynmode in autocad 2004. it is not working. i had read in some other website that this system variables are available from autocad 2007 onwards. whether its true or what. can u reply me regarding this. regards vivek Quote Link to comment Share on other sites More sharing options...
JohnM Posted November 9, 2009 Share Posted November 9, 2009 see if this get you close ;;; modemacro will display at the bottom left of the autocad screen before the coordinates read out (defun c:trk (/ pt1 c) (setq pt1 (getpoint "\nSelect a point: ")) (setq x T) (while x (setq ms (grread T 1)) (if (= (nth 0 ms) 5) (setvar "modemacro" (rtos(distance pt1 (nth 1 ms)))) (setq x nil) );_if );_while (setvar "modemacro" "");_reset modemacro );_defun Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 10, 2009 Share Posted November 10, 2009 see if this get you close ;;; modemacro will display at the bottom left of the autocad screen before the coordinates read out (defun c:trk (/ pt1 c) (setq pt1 (getpoint "\nSelect a point: ")) (setq x T) (while x (setq ms (grread T 1)) (if (= (nth 0 ms) 5) (setvar "modemacro" (rtos(distance pt1 (nth 1 ms)))) (setq x nil) );_if );_while (setvar "modemacro" "");_reset modemacro );_defun Interesting idea John. Give grtext a look, you can use it and avoid having to set/reset the modemacro system variable. You could also put: (redraw) (grdraw pt1 (cadr ms) 7) so the user has an idea of the origin point. I hope you take no offense to my blathering, just offering additional goodies. Quote Link to comment Share on other sites More sharing options...
JohnM Posted November 10, 2009 Share Posted November 10, 2009 No offence taken. That is what forums like this are for. Just remember there is always more than one way to skin a cat. But it still taste like chicken. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 10, 2009 Share Posted November 10, 2009 No offence taken. That is what forums like this are for.Just remember there is always more than one way to skin a cat. But it still taste like chicken. How right you are. Quote Link to comment Share on other sites More sharing options...
alanjt Posted November 10, 2009 Share Posted November 10, 2009 Just to go along with what I was saying... (defun c:Test (/ *error* #Pnt #Read #Dist) (setq *error* (lambda (x) (grtext) (redraw))) (and (setq #Pnt (getpoint "\nSpecify base point: ")) (while (eq 5 (car (setq #Read (grread T 15 0)))) (redraw) (grdraw #Pnt (cadr #Read) 1 1) (setq #Dist (strcat "Distance: " (rtos (distance #Pnt (cadr #Read))))) (princ (strcat "\r" #Dist " ")) (grtext -1 #Dist) ) ;_ while ) ;_ and (*error* nil) (princ) ) ;_ defun Quote Link to comment Share on other sites More sharing options...
vivekgrs Posted November 20, 2009 Author Share Posted November 20, 2009 thanks to everyone. its really helped me alot. what is the equivalent command of grread in vba. can anyone help me 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.