madonthemike Posted June 14, 2012 Posted June 14, 2012 Hi All, I found this lisp that would be really helpful at work, trouble is I can only get it to work partially. In short it creates a revision cloud and then inserts a revision tag (a triangle which is saved as a different drawing), the final stage is inserting the revision number(which is entered by user, say 3 for example) in the revision tag. I get to the part where it inserts the revision tag, and then I get the error message: Place the cloud's tag: Unknown command "3". Press F1 for help Here is part of the code: (setq m:REVNUM (getstring "\nEnter the revision set: ")) few lines of code later (setq m:PLACETAG (getpoint "\nPlace the cloud's tag: ")) (command "._insert" "cloudtag" m:PLACETAG (getvar "DIMSCALE") "" "0" m:REVNUM) I believe its something to do with syntax, I want to enter the value stored in m:REVNUM but somehow Im missing something. If it helps Im using Autocad 2010 To view complete code: http://delapp.com/cad/lisp/revcloud.lsp Quote
madonthemike Posted June 14, 2012 Author Posted June 14, 2012 Try it with Attreq set to 1 Tried it already, same error. Quote
MSasu Posted June 14, 2012 Posted June 14, 2012 I just tested that routine - it should work if ATTREQ is set to 1, the block is available and contains one attribute. Can you post the block here? Quote
pBe Posted June 14, 2012 Posted June 14, 2012 Well? My guess is it is. Its either you remove the extra "" (command "._insert" "cloudtag" m:PLACETAG (getvar "DIMSCALE") [b][color=blue]""[/color][/b] "0" m:REVNUM) to (command "._insert" "cloudtag" m:PLACETAG (getvar "DIMSCALE") "0" m:REVNUM) OR re-define your block: command: Block select "cloudtag" Ucheck "scale uniformly" that way you dont need to modify the code Quote
madonthemike Posted June 14, 2012 Author Posted June 14, 2012 I just tried it changing the attreq value, still doesnt work. now I created a random block myself, and I dont know it needs to be setup in a certain way for the lisp to work. I have attached the test block I use. cloudtag.dwg Quote
madonthemike Posted June 14, 2012 Author Posted June 14, 2012 Tried removing the "" , it asked me to manually input but ended up with the same result : Place the cloud's tag: Unknown command "0". Press F1 for help. Quote
BIGAL Posted June 15, 2012 Posted June 15, 2012 I would make a few changes remove m: not sure about this but Replace (getvar "dimscale") with dimsc and a new line at start (setq dimsc (getvar "dimscale")) others will advise about getting variables as answer to command Quote
pBe Posted June 15, 2012 Posted June 15, 2012 I just tried it changing the attreq value, still doesnt work. now I created a random block myself, and I dont know it needs to be setup in a certain way for the lisp to work. I have attached the test block I use. [ATTACH]35389[/ATTACH] Is it just me or the block you attched doesnt have an attribute. Quote
MSasu Posted June 15, 2012 Posted June 15, 2012 That's true; the block used by OP contains only one polyline and no attribute. So, if he/she will create one attribute in that drawing (if don't know how, please see this tutorial) the routine will work. Other condition is that the said block is placed on a folder in SFSP (Support File Search Path) list - but this condition seems to be already accomplished. Quote
pBe Posted June 15, 2012 Posted June 15, 2012 That's true; the block used by OP contains only one polyline and no attribute. Well that explains it. Quote
madonthemike Posted June 19, 2012 Author Posted June 19, 2012 That's true; the block used by OP contains only one polyline and no attribute. So, if he/she will create one attribute in that drawing (if don't know how, please see this tutorial) the routine will work.Other condition is that the said block is placed on a folder in SFSP (Support File Search Path) list - but this condition seems to be already accomplished. Thanks MSasu & pBE! Thats exactly what it was, the file i setup didnt have an attribute the lisp could pass a value to. Followed the tutorial and it worked great. Quote
MSasu Posted June 19, 2012 Posted June 19, 2012 Glad to hear that you got this sorted! Thank you for updating us. 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.