air_wolf Posted November 23, 2009 Posted November 23, 2009 hello, I'm searching for a routine (LISP or VBA) that will multiply a block to a given number of instances and that will also rename the blocks (like 1 to 200) it will not be a problem if 2 routines are involved. thanks in advance for help Quote
dbroada Posted November 23, 2009 Posted November 23, 2009 why? the advantage of blocks is that you have one definition in the drawing and 200 instances resulting in smaller drawing file that 200 identical blocks each with a different definition. Quote
air_wolf Posted November 23, 2009 Author Posted November 23, 2009 ok... that's way above me... what I need is a lisp that will multiply a line X times and will add numbers from 1 to X. maybe block is not the correct expression. "object" will be better? dunno, I'm a programmer, not an acad user, but this ended up on my desk... Quote
dbroada Posted November 23, 2009 Posted November 23, 2009 yes, object would be much better. An AutoCAD block is a collection of objects defined once and used many times. This would be better asked in the "LISP" forum but please don't multi post. Most of us wander from forum to forum. I'll see if a moderator is lurking and ask them to move it. no sorry, no moderator online atm. I'll keep looking but maybe somebody will be along to give you some assistance. To give the LISP guys something to work with, what excactly is the request that ended up on your desk? Quote
air_wolf Posted November 23, 2009 Author Posted November 23, 2009 thank you. I already did something by my own. still searching for a complete routine I'm able to multiply lines still having troubles with attributes... the request sounds like this: "we want to multiply this object X times and have the automatically numbered." Quote
dbroada Posted November 23, 2009 Posted November 23, 2009 I KNEW I should have posted again rather than modify the above post. Again, ATTRIBUTEs are particular to blocks. Do you need to use attributes or will TEXT do? From above, what excactly have you been asked to do. What language do you usually use and what do you want this in? Quote
Tiger Posted November 23, 2009 Posted November 23, 2009 Do you have the object? Is it something drawn? Is it bird or a mammal? err..sorry. But if what you need is a numbering system, as in have a balloon with automatic numbering sequence, that I know is here somewhere. Oh, and I moved the thread Quote
air_wolf Posted November 23, 2009 Author Posted November 23, 2009 I solved the problem 12 lines of code and one export to csv and one import from csv and that's it. thanks dbroada for enlightening me with the blocks Quote
dbroada Posted November 23, 2009 Posted November 23, 2009 now post the code in case somebody else can learn. Quote
air_wolf Posted November 23, 2009 Author Posted November 23, 2009 correct. the code below multiplies and object. ------cut here------------ (defun c:myProg() (if (setq myEnt(entsel)) (progn (setq i (getint "\n No. of objects: ")) (setq x 10) (setq y 10) (repeat i (setq x(+ x 10)) (setq y(+ y 10)) (command "copy" (car myEnt) "" x y) ) ) (alert "Select an entity!") ) (princ) ) ------------------cut here----------------- Quote
Recommended Posts
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.