Jump to content

Recommended Posts

Posted

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

Posted
Try it with Attreq set to 1

 

Tried it already, same error.

Posted

The block you are using is it unfiromly scaled?

Posted

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?

Posted

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

Posted

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

Posted

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.
Posted

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

Posted
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.

Posted

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.

Posted
That's true; the block used by OP contains only one polyline and no attribute.

 

Well that explains it. :)

Posted
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.

Posted

Glad to hear that you got this sorted! Thank you for updating us.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...