Insener07 Posted June 22, 2010 Share Posted June 22, 2010 Hey! i found this lisp routine (while (not (setq ent (entsel "\nChoose an object: ")))); (setq obj_curv (vlax-ename->vla-object (car ent))) (cond ((member (vlax-get-property obj_curv 'ObjectName) '("AcDbPolyline" "AcDb2dPolyline" "AcDbLine" "AcDbArc" "AcDbCircle" "AcDbEllipse" "AcDbSpline" "AcDbRay" "AcDbXline" ) ) (setq pt_sel (vlax-curve-getClosestPointTo obj_curv (trans (cadr ent) 1 0) ) [color=red]param (vlax-curve-getparamatpoint obj_curv pt_sel); how do understand this line[/color] [color=red]deriv (vlax-curve-getfirstderiv obj_curv param);how do understand this line[/color] [color=red])[/color] [color=red](setvar "snapang"[/color] [color=red](+ (atan (cadr deriv) (car deriv)) (/ pi 2))[/color] [color=red])[/color] As i understand it should change the angle of crosshair perpendicular to object chosen. I made some lines red and it seems this makes it happen. But I can't get how does it make it so?. What important does this param and deriv variables have? Can somebody explain me! Thanks M Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 First off: http://www.cadtutor.net/forum/showthread.php?t=9184 and just as important: http://www.cadtutor.net/forum/showthread.php?t=9184 Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 Put the code in VLIDE (Visual LISP editor built into AutoCAD), highlight the function in question, click on the question mark button and help will appear. eg. Quote Link to comment Share on other sites More sharing options...
Insener07 Posted June 22, 2010 Author Share Posted June 22, 2010 I'm kinda beginner in ALISP...so... Quote Link to comment Share on other sites More sharing options...
alanjt Posted June 22, 2010 Share Posted June 22, 2010 I just noticed, are you running LT, because LISP can't run on LT. Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted June 22, 2010 Share Posted June 22, 2010 Alan, Quick question: do you know a way to lock the toolbars in the VLIDE? They get on my nerves... PS> Don't know about you, but I prefer the Lucida Console (10pt, Regular) font when writing my code - seems 'cleaner' 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.