Archiman86 Posted March 4, 2009 Share Posted March 4, 2009 Ok, I have an interesting one this time. I have a series of lisp files that were created way before I started working here. They were created for a specific cleint (client 1) in order to insert blocks. We have a profile set up for that client (client 1) that loads the correct support paths and so forth. The problem lies herein: When i try to run these lisp files from a different profile (client 2), it doesnt work. More interesting than that, if i do the following steps it DOES work. (open autocad, options/load profile for Client 1, hit ok, options/load profile for Client 2, hit ok, then run the lisp it works! There must be a system variable, or something that is set by the profile for Client 1 that allows it to run. If I open autocad, options/load profile for client 2, hit ok, then try and load the lisp, that is when it doesnt work. For some reason, if the first profile is loaded before in the same instance of autocad, then it works...i would post the file up here....but it links to like 3 different .mnl files and other functions in other files.....If anyone has ANY clue or idea of something that I have missed trying, please let me know. I have been scanning text for hours now and I cant figure it out. I have checked all the support paths and such, and they are all the same. I cant figure it out. Like i said, these were all created by someone else, way before me. ::sorry if this post is really confusing:: Quote Link to comment Share on other sites More sharing options...
lpseifert Posted March 4, 2009 Share Posted March 4, 2009 Are the directories that contain the the .lsp files (and other necessary files) in the support paths of both profiles? Quote Link to comment Share on other sites More sharing options...
Archiman86 Posted March 4, 2009 Author Share Posted March 4, 2009 yes, they are. I did a screen capture for the first profile, and made sure of it. it is really boggling my mind. I still dont understand how if the first profile is loaded first, then it works.... in both. I caved in, and here is the code fo rthe main routine for inserting blocks. Like I said before, this was all done way before me: ; ;IN.LSP ; ;BY T.M.Kloba 9/23/94 ;"Smart" Block Inserter command interface: ;Uses (e:in) from PEI-CADTools-2000.MNL ; (defun C:IN (/ bname blay rot sym lyl lyn lyp) (setq m:err *error* *error* *merrmsg*) (setvar "cmdecho" 0) (setq bname (strcase (getstring (strcat "\nBlock name or ENTER to repeat :")))) (if (/= "" bname) (progn (initget 0 "Symbol Fixture") (setq sym (= "Symbol" (getkword "\nSymbol or Fixture:"))) (setq blay (strcase (getstring "\nLayer for block (precede with * for code) or ENTER for current:"))) (if (= "" blay) (setq blay (getvar "CLAYER"))) (setq rot (getangle "\nRotation angle or ENTER for onscreen:")) (setq lyl nil) (while (/= "" (setq lyn (getstring "\nLayer for attributes (precede with * for code) or ENTER when done:"))) (setq lyp (strcase (getstring "\nAttribute tag to put on this layer (wildcards OK, * for all):"))) (setq lyl (cons (list lyn lyp) lyl)) ) (if (not lyl) (setq lyl (list (list "0" "*")))) (setq e:i:bname bname e:i:blay blay e:i:rot rot e:i:sym sym e:i:lyl lyl) (e:in bname blay rot sym lyl) ) (e:in e:i:bname e:i:blay e:i:rot e:i:sym e:i:lyl) ) (setq *error* m:err m:err nil) (princ) ) (princ " IN - The Smart Block Inserter loaded.") (princ) as you can see, it references another .mnl file that has a ton of functions defined in it. When I try to run this in autocad, with animate debug on, it breaks at (strcat "\nBlock name or ENTER to repeat :"). all files are correctly in the support paths and everything. I dont get it! the function is called out as such in the menu file: ID_RevBlock [GE-RevBlock]IN;"Q:/Std/General Electric/Tblocks/GE-INT-TBLK";S;1;;;0,0;;\\(COMMAND "-LAYER" "S" LAYL);; also, here are the related functions fromt he other .mnl file: (defun e:lay (lnamec) (if (= "*" (substr lnamec 1 1)) (e:lya (substr lnamec 2)) lnamec) ) (defun e:in (bname blay rot sym lyl / oar sf) (setq oar (getvar "attreq")) (setvar "attreq" 0) (setq sf (if sym (getvar "userr1") (getvar "userr2"))) (command "layer" "m" (e:lay blay) "") (command "._insert" bname "pscale" sf) (princ "\nInsertion point: ") (command pause sf "") (princ "\nRotation angle: ") (command (if rot rot pause)) (e:ars) (foreach n (reverse lyl) (e:lat (e:lay (car n)) (cadr n))) (if (= 1 (cdr (assoc 66 (entget (entlast))))) (command "ddatte" "l") ) (setvar "attreq" oar) (princ) ) (setq e:i:bname "RD" e:i:blay "*EPOSY" e:i:rot nil e:i:sym T e:i:lyl (list (list "*EPOTX" "*")) e:sc:1 1 e:sc:2 12 e:sc:3 60 ...I think thats everything...but i may have missed some. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted March 4, 2009 Share Posted March 4, 2009 Are there separate acaddoc.lsp files, startup suites for each profile? Quote Link to comment Share on other sites More sharing options...
Archiman86 Posted March 4, 2009 Author Share Posted March 4, 2009 no, we jsut have one startup for all clients. This is what comes up in the command line when I try to run it fromt he second client's profile. Command: IN Initializing... IN - The Smart Block Inserter loaded.bad argument type: stringp nil Command: Command: "Q:/Std/General Electric/Tblocks/GE-INT-TBLK" Unknown command ""Q:/STD/GENERAL ELECTRIC/TBLOCKS/GE-INT-TBLK"". Press F1 for help. Command: S STRETCH Select objects to stretch by crossing-window or crossing-polygon... Select objects: 1 Specify opposite corner: Invalid window specification. Select objects: Specify opposite corner: Invalid window specification. Select objects: Specify opposite corner: *Cancel* 0 found Select objects: *Cancel* 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.