alcatel Posted January 27, 2015 Share Posted January 27, 2015 Does anyone know how to achieve this? I have a series of blocks with attributes in Autocad. Attribute is a number (from 1 to 500). Each of the blocks represents a single machine with serial number 1-500 on it. When I place a new block of machine (I do it by copy/paste from the nearby block) I just change the attribute value manually. Now, as a separate file I have excel sheet with two columns: COLUMN A -> serial number of machines (1-500) COLUMN B -> type of machine (e.g. TYPE-1, TYPE-2, TYPE-3...), around 8 types in total Is it possible to make a block with two values in it (attributes) and when a value of machine serial number in position 1 is changed it will look the excel file and return the machine type in position 2. Something like VLOOKUP excel formula, but in AUTOCAD. For example if EXCEL is: COLUMN A / COLUMN B 250 / TYPE-3 251 / TYPE-5 Than the change in AutoCAD attributes in position 1 and 2 is like this: ATT-1: 250 ATT-2: TYPE-3 if I manually change ATT-1 to value 251, then: ATT-1: 251 ATT-2: TYPE-3 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted January 28, 2015 Share Posted January 28, 2015 I would look at some of the incrementing lisps so when add block it adds next number automatically. They work by looking up your block and retrieving the highest value. have a Look at www.Lee-mac.com auto numbering suite. Here is an example of finding last number. (setq ss1 (ssget "x" '((2 . "setout_point")))) (setq pno 0) (setq n (sslength ss1)) (setq index 0) (repeat n (setq en (ssname ss1 index)) (setq index (+ index 1)) (setq en1 (entnext en)) (setq el1 (entget en1)) (setq att (atoi (cdr (assoc 1 el1)))) (if (> att pno) (setq pno att)) );repeat (setq pno (+ pno 1)) Quote Link to comment Share on other sites More sharing options...
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.