Jump to content

Looking for a LISP routine...


tzframpton

Recommended Posts

Anyone have a Lisp routine of a keynote (circle keynote prefereably) with an attribute that when you copy it, it numbers automatically? i have to number HVAC grille locations per Unit, and so i have a lot of "repeating" keynotes. it just has to start from one and go up until i stop the routine, and start back from one when i restart the routine. Anyone have anything like this laying around in a dusty corner of your hard drive?? Thanks in advance..... :)

Link to comment
Share on other sites

Play around this one

There is not exactly what you need

but may helps

Change a keynote block name and tag to

your suit

 

~'J'~

 

(defun c:ibl (/ atd blk cnt ech ipt next next_data osm tag)
 (setq osm (getvar "osmode"))
 (setq ech (getvar "cmdecho"))
 (setq atd (getvar "attdia"))
 (setvar "osmode" 0)
 (setvar "cmdecho" 0)
 (setvar "attdia" 1)

 (setq cnt (getint "\nEnter first number: "))
 (if cnt
 (progn
 ;(setq tag (strcase (getstring "\nEnter attribute tag for numbering: ")))
 (setq tag "SEQ");change attribute tag "SEQ" to your suit
 

(while (setq ipt (getpoint "\nPick insertion point"))

(command "-insert" "ONE" ipt 1 1 0);<- change block name "ONE" here
(setq blk (entlast))
(setq next blk)
       (while (setq next (entnext next))
(setq next_data (entget next))
(if (= tag (cdr (assoc 2 next_data)))
  (progn
    (entmod (subst (cons 1 (itoa cnt)) (assoc 1 next_data) next_data))
    (entupd blk)
  )
)
     )
	    (setq cnt (1+ cnt))
	    )
     )
   )

 (setvar "osmode" osm)
 (setvar "attdia" atd)
 (setvar "cmdecho" ech)
 (prin1)
 )
(prompt "\ntype iBL to execute ...")
(prin1)
;;;TesT : (c:ibl)

Link to comment
Share on other sites

Fatty, you are the friggin' MAN. awesome dude, thanks... worked PERFECT. 8)

 

EDIT: VVA, thanks for the links, i'll check those out too. but Fatty made exactly what i was looking for. :wink:

Link to comment
Share on other sites

  • 6 years later...

Hi,

 

I tried to run this script.. Here's what AutoCAD does:

 

1. Asks my input for Start of Sequence number.

2. Inserts the block

3. The attribute dialog pops up

4. I re-enter the sequence number there

5. The block gets the attribute

6. Click on empty space and it begins from step 1.

 

Although, I was able to achieve what I wanted to I was wondering if there was anyway to make this work. I am working on AutoCAD 2013 just in case that matters.

Link to comment
Share on other sites

I know fatty gave you what you needed but I remember Lee used to have a cracker of an Incremental numbering lisp.

 

http://www.lee-mac.com/numinc.html

 

(It looks a little more advanced now than what i remember when he first wrote it)

 

 

 

 

I've just noticed this post is several years old. Sorry

Edited by stevsmith
Made an ass of myself not noticing the date.
Link to comment
Share on other sites

Steve and LeeMac Thanks for your input guys. This was what I was looking for! I just hope this works fine with my version of AutoCAD! Much appreciate the quick replies!

 

I know fatty gave you what you needed but I remember Lee used to have a cracker of an Incremental numbering lisp.

 

http://www.lee-mac.com/numinc.html

 

(It looks a little more advanced now than what i remember when he first wrote it)

 

 

 

 

I've just noticed this post is several years old. Sorry

Link to comment
Share on other sites

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