×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

LISP-routine

LISP-routine

LISP-routine

(OP)
Hi,

I'm searching for a lisproutine that can do the following thing.
 - It asks a string (for instance "N12.")
 - It asks an incremental startnumber (for instance "1")
 - It asks to select objects
 - It places the string together with the incremental number in an attribute "KRING"

The result must be this:
Attribute1:          Attribute2:          Attribute3:
N12.1                N12.2                N12.3

The way the objects are selected is also the way the number are incremented and placed.


Can anyone help me for this problem?

regards
HMO

RE: LISP-routine

I believe ToolPac from www.dotsoft.com has this capability.

RE: LISP-routine

Dear Hmo,

The following code converts the text and dimension objects as you defined above. The code defines a new command "SNN".


(defun c:snn( / e elist n pstr )
  (setq pstr (getstring "\n   String: "))
  (if (/= pstr "")
    (setq pstr (strcat pstr "."))
  )
  (if (not (numberp *nncounter*))
    (progn
      (initget 1)
      (setq *nncounter* (getint "\n   Start from: "))
    )
    (progn
      (princ "\n   Start from <")
      (princ (rtos *nncounter* 2 0))
      (princ ">: ")
      (setq n (getint))
      (if (numberp n)
    (setq *nncounter* n)
      )
    )
  )
  (while (setq e (entsel))
    (command "._UNDO" "G")
    (setq elist (entget (car e)))
    (setq elist (subst (cons 1 (strcat pstr
         (itoa *nncounter*)))
                    (assoc 1 elist) elist))
    (entmod elist)
    (command "._UNDO" "E")
    (setq *nncounter* (1+ *nncounter*))
  )
  (princ)
)



Regards,
Farzad

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources