Assigning an attribute or descriptors to Hatch

Assigning an attribute or descriptors to Hatch

chloeleyba8NWHJ
Participant Participant
1,187 Views
15 Replies
Message 1 of 16

Assigning an attribute or descriptors to Hatch

chloeleyba8NWHJ
Participant
Participant

Hi all. Not sure if this is the right location, but I feel that because it is under the umbrella of customization, somebody might point me in the right direction.

 

I want to know if it is feasible to attach a descriptor or attribute to a hatch pattern, as so when I use the data extraction function I can compile a greater amount of information from the hatch.

 

I know its a long shot but worth asking.

0 Likes
1,188 Views
15 Replies
Replies (15)
Message 2 of 16

ec-cad
Collaborator
Collaborator

You (could) attach XDATA to the hatches, then with some other Lisp, read it back.

Search this Forum for "XDATA" and read-up on how to attach it to an entity, and read

it back later.

 

ECCAD

 

0 Likes
Message 3 of 16

john.uhden
Mentor
Mentor

@ec-cad ,

I prefer ldata as it doesn't require adherence to xdata codes, and it can store a lot of data, and data of all types too, and I think it's simpler as well.

John F. Uhden

0 Likes
Message 4 of 16

Sea-Haven
Mentor
Mentor

Google Xdata Afralisp has a good XDATA example.

 

Like John use Ldata only issue would be say need to add "handle" of object to say your extra info so can check does object still exist. Other wise Ldata will return info on objects that don't exist. But yes Ldata much easier to add.

0 Likes
Message 5 of 16

john.uhden
Mentor
Mentor

@Sea-Haven ,

You can add entity handles to Ldata any way you want, e.g. ("INSERT_HANDLE" . <handle>)

Obviously, when retrieving either Xdata or Ldata, one must check if the handle is still applicable.

John F. Uhden

0 Likes
Message 6 of 16

komondormrex
Mentor
Mentor

unfortunately neither xdata nor dictionary attached will be handled with the native _dataextraction command. on the other hand, you may attach a hyperlink with some text to display to a hatch, which could be handled.

0 Likes
Message 7 of 16

paullimapa
Mentor
Mentor

What additional data you’re thinking of adding to the hatch object to Dataextract out?


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 8 of 16

chloeleyba8NWHJ
Participant
Participant

Hi, 

I'm trying to attach such things as specific product information including vendor, cost associated with sq foot, color..... Things similar to what an attribute would be for a block.

0 Likes
Message 9 of 16

john.uhden
Mentor
Mentor

@chloeleyba8NWHJ ,

I was just thinking (that's dangerous) that if the hatch need not be interactive, then you could include it in a block definition that has all the attributes you want.  They need not be visible, but they are easily editable and extractible.

Oh, and rather than having to deal with multiple block names, anonymous blocks can have attributes.  I'll donate my UBLOCK.lsp to make it easy for you.

John F. Uhden

0 Likes
Message 10 of 16

Sea-Haven
Mentor
Mentor

Why not a block with a circle = 0.000001 rad, and as you suggest the attributes set to invisible. Then only 1 block name. Oh yeah put on a preferred layer name. Using a lisp can enter all the attribute values before inserting so could have like hatch area and pattern name, plus more, set some defaults also.

0 Likes
Message 11 of 16

АлексЮстасу
Advisor
Advisor

Hi, @chloeleyba8NWHJ ,

 

The forum has a enough large set of free user tools for working with XData - XDTOOLS.
They can create and edit XData definitions, attach necessary XData to many objects at once, edit XData field contents, select objects by names of attached XData and field contents, etc.
These tools allow to create hyperlinks from XData, can export XData content to txt, csv, etc.


+ for XData there are two commands from Exress.

 

... I know programmers really dislike it when users want to apply XData.
So these lisp programs were written by very inexperienced amateurs. But these programs solve their tasks quite well.
My fault, I repent.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes
Message 12 of 16

scot-65
Advisor
Advisor

Old school method:

Register an application and embed into object:

(if (setq d (entsel "\nSelect text object for REVISION 01 TEXT: "))
 (progn
  (if (not (tblsearch "appid" "REV01T")) (regapp "REV01T") );if
  (entmod (append (entget (car d)) '( (-3 ("REV01T" (1000 . "Anything goes between the double quotes"))))))
 );progn
);if

 

To fetch the object:

(setq s (ssget "x" '((-3 ("REV01T")))))

 

 


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.

0 Likes
Message 13 of 16

john.uhden
Mentor
Mentor

@chloeleyba8NWHJ ,

My apologies... I lied.

Apparently you can't add attributes to anonymous blocks.

John F. Uhden

0 Likes
Message 14 of 16

john.uhden
Mentor
Mentor

@scot-65 ,

And can't you have multiple 1000s?  Like one for each of the strings he wants to store?

John F. Uhden

0 Likes
Message 15 of 16

Sea-Haven
Mentor
Mentor

Not sure if this is correct combing say existing with more hatch details.

 

 

(entmod (append (entget (car d)) '( (-3 ("REV01T" (1000 . "Anything goes between the double quotes")(1000 . "Anything goes 2")(1000 . "Anything goes 3"))))))

 

((-1 . <Entity name: 762a9080>) (0 . "TEXT") (5 . "11C49") (102 . "{ACAD_XDICTIONARY") (360 . <Entity name: 762a8540>) (102 . "}") (330 . <Entity name: 692503d0>) (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "DEFAULT") (100 . "AcDbText") (10 -1.7884872585377 -3.07432732234874 0.0) (40 . 0.25) (1 . "ABCDE") (50 . 0.0) (41 . 1.0) (51 . 0.0) (7 . "Standard 2.5") (71 . 0) (72 . 0) (11 0.0 0.0 0.0) (210 0.0 0.0 1.0) (100 . "AcDbText") (73 . 0) (-3 ("REV01T" (1000 . "Anything goes between the double quotes") (1000 . "Anything goes 2") (1000 . "Anything goes 3"))))

 

Should be a easier way to entmod the -3. I don't use regapp so don't know.

0 Likes
Message 16 of 16

АлексЮстасу
Advisor
Advisor

Hi, @chloeleyba8NWHJ 

 

I'm trying to attach such things as specific product information including vendor, cost associated with sq foot, color..... Things similar to what an attribute would be for a block.

 

1. Create an XData definition for the desired product information - XDTOOLS_MDEFINE. Attach such XData to the hatches - XDTOOLS_ADD.
2. Enter the required information into the XData fields - XDTOOLS_VEDIT.
3. Create inscriptions for product information from XData - XDLABEL_CREATE.
These inscriptions will be analogous to attributes, i.e. each inscription will be linked with its own object. The content of each inscription will be linked with a specific XData field of its object.
In this case, these inscriptions are the usual Text, MText, Leader or MLeader. No Proxy.

hatch_attrib.png

The linkage can be maintained by the XDLABEL_UPDATE command - restoring the relative inscriptions position at their objects, restoring the inscriptions content . Or vice versa - saving new position and inscriptions content in XData of their objects.

 

Another case - if the inscriptions have already been made. In this case it is possible to link inscriptions with their objects with saving their content in the objects XData fields - XDLABEL_LINK.

 


-- Alexander, private person, pacifist, english only with translator 🙂 --

Object-modeling _ odclass-odedit.com _ Help

0 Likes