Jump to content

Carpark Numbering


GJBarron

Recommended Posts

is there any way you can number spaces so they update automatically for example if you delete one? ie 1 2 3 4 5 you remove space 3 and it renumbers 1 2 3 4

 

thanks

Link to comment
Share on other sites

Are you using LT as your profile states? Or do you have access to the full version?

 

I was thinking either FIELDS or Reactors - but in both situations the program would be quite complex.

Link to comment
Share on other sites

Are you using LT as your profile states? Or do you have access to the full version?

 

I was thinking either FIELDS or Reactors - but in both situations the program would be quite complex.

 

 

I can gain access to autocad full.

Link to comment
Share on other sites

The following code will not update automatically

as you wanted be but you can do it by selection

these texts on screen (probably you need to

add other selection otions to the filter list say

like textstle, textsize, layer etc

Sorry I haven't have a time to test it

 

(defun c:renum (/ elist entlist init sset)
 (command "._zoom" "_e")
 (if (setq sset (ssget "X"
       (list
  (cons 0 "*TEXT")   ;<-- tetx,mtext
  (cons 1 "#,##,###,####")  ;<-- select integer numeric text only like: 1,22,333,4444
  (cons 410 (getvar "ctab"));<-- current tab
  ))
    )
   (progn
     (setq init (1- (atoi
    (cdr
      (assoc 1
      (entget
        (car
   (setq entlist
   (vl-sort      
     (vl-remove-if
       'listp
       (mapcar 'cadr (ssnamex sset)))
    (function (lambda (a b)
         (< (cdr (assoc 1 (entget a)))
            (cdr (assoc 1 (entget b))))))
    ))))))
    )
)
    )

     (foreach en  entlist

(setq elist (entget en))

(princ (strcat "\n ===>>> Number "
      (cdr (assoc 1 (entget en)))
      " was replaced with "
      (itoa (1+ init)))
      )

(entmod (subst (cons 1 (itoa (setq init (1+ init))))
        (assoc 1 elist)
        elist))

)
     )
   )
 (command "._zoom" "_p")
 (princ)
 )

 

~'J'~

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