AJSmith Posted February 4, 2010 Posted February 4, 2010 i have a LISP for a tadpole but it dont work i get Command: tadpole Pick Bottom of Slope : Pick Top of Slope : INSERT Enter block name or [?]: Z:/CAD GLOBAL CONFIG/GLOBAL STANDARD SYMBOLS/GENERAL/GLOBAL TADPOLE "GLOBAL TADPOLE.dwg": Can't find file in search path: Z:\E Network\003 Incident Management\12 Contingency Planning\Mat Troke\ONDR To Area 7\N8\RAC\ (current directory) C:\Documents and Settings\adam.smith\application data\autodesk\autocad 2010\r18.0\enu\support\ C:\program files\autocad 2010\support\ C:\program files\autocad 2010\fonts\ C:\program files\autocad 2010\help\ C:\program files\autocad 2010\express\ C:\program files\autocad 2010\support\color\ C:\Program Files\AutoCAD 2010\drv\ C:\Program Files\AutoCAD 2010\ *Invalid* ; error: Function cancelled the lisp file is ;;; inserts a scaled Global tadpole symbol and rotates to suit (DEFUN C:TADPOLE () (SETQ PT1 (GETPOINT "\nPick Bottom of Slope : ")) (TERPRI) (SETQ PT2 (GETPOINT PT1 "Pick Top of Slope : ")) (SETQ TSZ (DISTANCE PT1 PT2)) (SETQ ANG (+ (ANGLE PT1 PT2) (/ PI 2))) (SETQ ANG (* ANG (/ 180 PI))) (COMMAND "INSERT" "Z:/CAD GLOBAL CONFIG/GLOBAL STANDARD SYMBOLS/GENERAL/GLOBAL TADPOLE" PT1 TSZ "" ANG) (TERPRI) (princ) (PRINC "\nTadpole Inserted") (princ) ) any ideas?? Quote
SteveK Posted February 4, 2010 Posted February 4, 2010 I haven't tested this what if you try one of the highlighted changes (below)? First just try the dash then try changing the slashes. (COMMAND "[b][color=Red]-[/color][/b]INSERT" "Z:[color=Red]\[/color]CAD GLOBAL CONFIG[color=Red]\[/color]GLOBAL STANDARD SYMBOLS[color=Red]\[/color]GENERAL[color=Red]\[/color]GLOBAL TADPOLE" PT1 TSZ "" ANG) Note: the dash supresses the insert dialog box. Quote
AJSmith Posted February 4, 2010 Author Posted February 4, 2010 o god im going totaly stupid forget this i have got this lisp from another company so the fil path is the problem so clear once you look at it thanks anyway Steve Quote
Lee Mac Posted February 4, 2010 Posted February 4, 2010 I would approach it like this: (defun c:TadPole (/ InsertBlock p1 p2) (vl-load-com) (defun InsertBlock (blk pt scl ang) (setq *doc (cond (*doc) ((vla-get-ActiveDocument (vlax-get-acad-object))))) (cond ( (not (or (and (eq "" (vl-filename-extension blk)) (tblsearch "BLOCK" blk) (setq blk (findfile (strcat (if (eq "" (vl-filename-extension blk)) ".dwg" ""))))) (setq blk (findfile blk))))) ( (vla-InsertBlock (if (zerop (vla-get-ActiveSpace *doc)) (vla-get-PaperSpace *doc) (vla-get-ModelSpace *doc)) (vlax-3D-point pt) blk scl scl scl ang)))) (if (and (setq p1 (getpoint "\nPick Bottom of Slope: ")) (setq p2 (getpoint "\nPick Top of Slope: " p1))) (InsertBlock "C:\\Users\\myBlock.dwg" p1 (distance p1 p2) (+ (angle p1 p2) (/ pi 2.)))) (princ)) Change the path as necessary. If using a full filepath for the block, use double backslashes. Else the path can be "block.dwg" or just "block". 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.