old lisp file help

old lisp file help

MatthewDBell
Enthusiast Enthusiast
917 Views
3 Replies
Message 1 of 4

old lisp file help

MatthewDBell
Enthusiast
Enthusiast

Ok so I have been searching for and answer for this for a while and haven't found the solution. We have some old lisp files that we used to insert things like revision markers and torque balloons and stuff. Well at some point they quite working and I am not sure why.

 

Here is the code:

;INSERT REVISION TRIANGLE
(defun c:rev()
     (setq num (getstring "\nEnter revision number:"))
     (command "insert" "i:/blk/standard/veco_rev" pause (getvar "dimscale") "" ""))

The problem is that after being prompted for the revision number when it inserts the block the block comes in with just the default attribute value.

 

I will admit I know next to nothing about lisp syntax.

 

Any help would be appreciated.

0 Likes
Accepted solutions (1)
918 Views
3 Replies
Replies (3)
Message 2 of 4

Shneuph
Collaborator
Collaborator
Accepted solution

The code you posted saves a user input string to the "num" variable but then never uses the variable again.

 

This will work:

(defun c:rev()
     (setq num (getstring "\nEnter revision number:"))
     (command "insert" "rev delta" pause (getvar "dimscale") "" num)
  );defun

(put our block name back in where I put "rev delta")  The attribute must not be "preset." You will need to verify some system variables as well; attdia variable set to 0, Attreq must also be 1.

 

Hope you get it to work.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 3 of 4

ВeekeeCZ
Consultant
Consultant
Check ATTREQ and ATTDIA system variables.
0 Likes
Message 4 of 4

Kent1Cooper
Consultant
Consultant

First guess:  You need the 'num' variable to be fed into the Insert command at the end, something like:

 

(command "insert" "i:/blk/standard/veco_rev" pause (getvar "dimscale") "" "" num))

 

but it would also be affected by whether the Block is defined for uniform scaling [the number of Enters for scale and rotation defaults].  Why that would have changed "at some point," if it used to work, only you could determine.

 

If that doesn't fix it, check your ATTREQ System Variable value [read about it in Help].

Kent Cooper, AIA
0 Likes