asos2000 Posted October 28, 2010 Share Posted October 28, 2010 A question from a begginer: How to add a data to mouse pointer such as LEE lisp DInfo? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 28, 2010 Share Posted October 28, 2010 You will need to master the grRead function to accomplish that - it tracks all user input from mouse & keyboard, hence in a loop one can continously monitor user input. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted October 28, 2010 Author Share Posted October 28, 2010 Is there an simple example? Because I tried to study DInfo lisp but lost. Its higher technique more than my little knowledge. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 28, 2010 Share Posted October 28, 2010 Have you read the help file on grRead? I can provide an example, but it would serve no purpose if you didn't know how grread functioned. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted October 28, 2010 Author Share Posted October 28, 2010 In fact I did but didnt understand the help file. Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 28, 2010 Share Posted October 28, 2010 Clunky example I did. You have to understand, grread is neat and fun, but mostly it's useless and requires too much work/aggravation for the tiny payoff. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted October 28, 2010 Author Share Posted October 28, 2010 Its a poor start starting from a lisp from this thread But have 2 errors - when point to Vertical line - when point to pline (defun C:IntLine () (prompt "\nMove Crosshairs To Inspect Objects.") (while (and (setq INPUT (grread T)) (= (car INPUT) 5) ) (setq INPUT_COORD (cadr INPUT)) (setq ENTITY_FOUND (ssget INPUT_COORD)) (if ENTITY_FOUND (Progn (setq ENTITY_LIST (entget (ssname ENTITY_FOUND 0))) (setq p1 (cdr (assoc 10 ENTITY_LIST))) (setq p2 (cdr (assoc 11 ENTITY_LIST))) (setq tan2 (/ (- (cadr p2) (cadr p1)) (- (car p2) (car p1)))) (prompt (strcat "\rObject: " (rtos (abs (* tan2 100))2 2) "% ")) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 28, 2010 Share Posted October 28, 2010 LWPolylines don't have 11 codes. If you are just wanting start and end, I'd suggest the vlax-curve-getStartPoint, vlax-curve-getEndPoint (and no, you don't have to convert to vla-objects). However, for what you're doing, I'd also filter the polylines to only have one segment (dxf code 90, I think); you don't want to make your calculation based on a polyline with 75 bends, when you are wanting the angles between the start and end points. Quote Link to comment Share on other sites More sharing options...
alanjt Posted October 28, 2010 Share Posted October 28, 2010 Oh yeah, you might also be interested in grtext; it will display your message at the bottom left of the AutoCAD window. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted October 28, 2010 Share Posted October 28, 2010 Quick example I suppose: (defun TextDisplay ( text / e l gr vs ) (if (setq e (entmakex (list (cons 0 "TEXT") (cons 10 (getvar 'VIEWCTR)) (cons 40 (/ (getvar 'VIEWSIZE) 30.)) (cons 1 text) (cons 62 3) (cons 72 0) (cons 73 3) (cons 11 (getvar 'VIEWCTR)) ) ) ) (progn (setq l (entget e)) (while (= 5 (car (setq gr (grread 't 13 0)))) (setq vs (getvar 'VIEWSIZE)) (entupd (cdr (assoc -1 (entmod (subst (cons 11 (trans (polar (cadr gr) (/ pi -4.) (/ vs 20.)) 1 0)) (assoc 11 l) (subst (cons 40 (/ vs 30.)) (assoc 40 l) l) ) ) ) ) ) ) (entdel e) ) ) (princ) ) (defun c:test nil (TextDisplay "Lee Mac") (princ)) Quote Link to comment Share on other sites More sharing options...
aazaaz Posted December 6, 2010 Share Posted December 6, 2010 DInfo return error for entity "POLYLINE" into XREF and INSERT... 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.