Block Attribute value list

Block Attribute value list

cbenner
Mentor Mentor
9,608 Views
8 Replies
Message 1 of 9

Block Attribute value list

cbenner
Mentor
Mentor

I've been researching this, and so far all I can find is that, in order to have a list of values for an attribute you need to use the visibility states of a dynamic block.  Is this still truly the only way to have a value list for an attribute or part of an attribute?

 

I am toying with a tag that has multiple sections, each one pulled from a very large table of possible values.  From what I am seeing, this cannot be done?  Reference this example from AutoCAD P&ID (which we will not use much longer).  These tag sections each pull from a predefined table of values.  When Assign is clicked, it concatenates these into an attribute and places it into the drawing.  Do I have any options of doing something like this in AutoCAD?

 

Thanks in advance for any advice.  Please be gentle, my programming "skills" are practically nil.

 

tag.PNG

 

 

0 Likes
Accepted solutions (1)
9,609 Views
8 Replies
Replies (8)
Message 2 of 9

Ranjit_Singh
Advisor
Advisor

The last time I worked with P&ID diagrams, I was using Microstation. So I have never come across that screenshot you posted. I don't think AutoCAD has a built-in command for that. But you could combine tags with some customization. See below for example. One could use the combined string and add it to some other element of the drawing (block, mtext, table, etc.)

(defun c:somefunc  (/ ent etdata lst)
 (if (setq ent (car (entsel "\nSelect block: ")))
  (while (/= "SEQEND" (cdr (assoc 0 (setq etdata (entget (setq ent (entnext ent)))))))
   (setq lst (cons (cdr (assoc 1 etdata)) lst))))
 (vl-string-right-trim " " (apply 'strcat (mapcar '(lambda (x) (strcat x " ")) lst))))

comb_tags.gif

 

0 Likes
Message 3 of 9

john.uhden
Mentor
Mentor
Accepted solution

Speaking from a purely AutoLisp perspective, I would say the answer is yes.  I would recommend using a dialog box (DCL) where you can incorporate edit boxes, list boxes and pop-up lists for data entry or selection, and the accompanying lisp routine could concatenate whatever values you have entered or selected and put the results most any place you wish, e.g. text, mtext, or block attribute, and many other nongraphic places.  But it would not be a 5 minute task that many gurus here would knock off for you while they took a sip of coffee.  I expect you would have to pay for such services and spend some time of your own coordinating input lists, appearance, and output to the drawing.

John F. Uhden

Message 4 of 9

cbenner
Mentor
Mentor

@john.uhden

 

Thank you for the frank and honest reply.  I would never expect anyone to simply do this for me, though I wouldn't turn such kindness down!  Smiley Very Happy  I expected that, if possible, this would be a fairly large job.  I just wanted to really know if I should even pursue it or not.  Based on what you say, this is something I should look at more closely.  I was actually picturing exactly what you suggest, I just didn't know if it were possible.  I played with .dcl files many (MANY) years ago and some simple lisp code.  Maybe I need to dust off my books and take another look.

 

Thanks again!

0 Likes
Message 5 of 9

john.uhden
Mentor
Mentor

Oh, c'mon.  You've got kudos and solutions galore.  It'll probably be just like riding a bike... you'll get to skin your knees all over again.  Smiley Wink

And we can apply some bandages if you need them.

John F. Uhden

Message 6 of 9

cadffm
Consultant
Consultant
"you need to use the visibility states of a dynamic block"

In some situation thats a possible way and blocks (attributes) has not the function you want.

Without programming like the visiblestate way is,
there is another (non perfect but better) way with dynamic blocks:
Set the attributvalue with look up actions!
The non-perfect thing is: the Attribut fields in properties palette always displayd.

Sebastian

0 Likes
Message 7 of 9

cbenner
Mentor
Mentor

@cadffm wrote:
"you need to use the visibility states of a dynamic block"

In some situation thats a possible way and blocks (attributes) has not the function you want.

Without programming like the visiblestate way is,
there is another (non perfect but better) way with dynamic blocks:
Set the attributvalue with look up actions!
The non-perfect thing is: the Attribut fields in properties palette always displayd.

@cadffm

 

Can you give a bit more information on how to do this?  I've been looking at this, and I don't see how to tie lookups to anything except a dimensional parameter.  I can tie an attribute to a Block Table, so I could create an invisible attribute for each of the portions of my tag number, and get the value for each from a block table.... but then I still need to concatenate them into a single string or attribute.  

0 Likes
Message 8 of 9

cadffm
Consultant
Consultant

See attachment.

But really well is only a program-extension which popup if user want to edit the attributvalues and
the block is detected as "yourBlock" and the valid values are stored in an database (or xdatas).

attedit/eattedit -> is Block listed in my database? (in this kind) ->
YES=> start my own dialog
NO=> start standard dialog

 

 

Sebastian

0 Likes
Message 9 of 9

Anonymous
Not applicable

Sorry my bad English. but... 

I just figured it out. Now I know how it all works😂
All off it from  010->to 255.255.255.
Jeesus Kristus...
Is it really that simple?
 
...OMG, I'am almighty 🙄
🤔
😁
0 Likes