I invite to participate in an open project to create the common free user tools for XData - XDTOOLS.
It would be better to solve this problem based not on XData, but on Xrecord. But doing this is more difficult, and I did not find ready-made developments.
The goal is to give users in base AutoCAD a convenient and productive opportunity to add descriptive/additional information to graphic elements and use it.
And thus, make it possible to make the models/drawings more informative, and use AutoCAD more productive.
Naturally, this should be expected from Autodesk itself. But he limited himself to two weak, uncomfortable, with errors commands in Express, 20 years ago.
For Xdata, there are many free Lisp's, which can be use for creatting the desired set of commands - see archive on googledisk, XData_32_collection_Readme.zip .
But these tools need to be made convenient, productive, fully functional and safe.
Can be 10-12 commands in XDTOOLS for:
I. Managing XData Apps descriptions.
Create/edit Apps descriptions, detect problems and errors.
II. Using XData Apps:
Adding/removing Apps to graphical elements, entering values, viewing/editing values, searching for objects with Apps and specified values.
III. Transfer, communication with XData Apps:
Saving/loading data from XData to another representations. Exchange data with vertical applications AutoCAD and other software.
I am not a programmer at all, I propose this project as a user. And I hope for the participation of programmers.
Don't need much to create. It's not hard to create. But this can help to qualitatively improve the use of AutoCAD.
Added later:
20 XDTOOLS commands have now been made - see attached archive with Palette commands.
Added later:
A development of the XData use and a continuation of the XDTOOLS project is the XDLabel pilot-project - bulk inscriptions creation from the XData fields values, the creation of a link between inscriptions and their objects, and the restoration of inscriptions.
See from #37 and XDLABEL.fas. Last - #41-43. Five commands. Commands are updated and improved.
Added later:
The second XDPoint subproject is creating and using links for "point" objects: Points, Blocks, Circles, 3DSolids, Tables, Lines. The first three basic commands are.
See from #38 and XDPoint.fas.
Added later:
The command common to XDLink and XDPoint for selecting related labels and/or point objects is XDLINK_SINGLESEL. Performed for one specified object - for unambiguity.
See #39.
Can use the palette (Ctrl 3) - en_XDTOOLS.xtp - to call the XDTOOLS commands.
After unpacking the archive, import this palette in the TOOL PALETTES window.
The commands will be called if they are loaded (_APPLOAD) into AutoCAD.
☹️☹️☹️☹️
Another command to test, XDTOOLS_2CSV - unload data from XData into csv, txt files.
In two options: a common file and separately for each XData Application.
In the second case - with a homogeneous structure. The names of the created csv/txt are formed from the dwg name, the "&" symbol and the XData Application names.
For the common file, the name is created from the dwg name.
The resulting csv, txt can be imported directly or, with a fairly small modification, into Object Data, block attributes, etc.
With XDTOOLS_2CSV it is now possible to quickly unload data from XData, make any changes (in Excel or the like), and load it back.
Or use descriptive, attributive data to create explications, reports, etc.
Shared archive of all XDTOOLS commands along with the command palette. Commands with corrections.
Hello
I noticed that the program does not work with dynamic blocks.
Unfortunately I don't know lisp.
Would it be possible to modify the program to work with dynamic blocks?
I did some research and I think it would be helpful.
https://www.theswamp.org/index.php?topic=51419.0
Greetings
@jaskrz007, Thanks for the comment!
Need an example of blocks that XDTOOLS_ATTR doesn't work with.
@АлексЮстасу I'm attaching sample files
For dynamic blocks I have this message: "In selection there are no blocks from the matching file"
Hi, Krzysztof,
Try the XDTOOLS_ATTR version for any blocks, including dynamic blocks.
@jaskrz007 , Excuse me! Didn't notice that the browser ate the lsp yesterday.
Hi@АлексЮстасу great job. Now works.
It would be convenient if the last used template file was remembered
Unfortunately I can't do it
I can be your tester 🙂
Thank you for testing!
Unfortunately, I am not a programmer. I pass on the remarks to the authors of the programs.
Try the version with path memorization.
The selection starts with the dwg folder.
Hi @АлексЮстасу Thank you
Now it's more convenient. Perhaps it would be good if it was possible to confirm the previously used file on the command line.
In my humble opinion, the ideal solution would be to create a program that would automatically update xdata after changing the attribute and vice versa.
In principle, making XData / attributes automatically update is a good idea.
But I'm not a programmer, and I don't even know if this can be done in lisp.
On the other hand, attribute updates are done rarely, 1-2 times per project.
On the third hand, changes in XData or attributes can be erroneous, and with automatic changes there will be no way to restore values.
In my case, changes are frequent. Automatic updating would keep the data consistent. Following the forum, I suspect it is possible. I also saw an interesting lisp by Lee Mac http://www.lee-mac.com/autolabelattributes.html uses an Object Reactor to monitor modification events.
Perhaps one of the other forum members reading this thread would be able to help.
The forum administration moved this my topic to the current section, where few of the potentially interested can see it.
That's why it's better to ask about the possibility you need on the forum - Visual LISP, AutoLISP and General Customization - Autodesk Community.
For what tasks do you create models?
What data do you use XData for?
What other commands from XDTOOLS were useful to you?
And what actions with XData do you miss?
Thanks for the advice
I'm just learning to use xdata.
I work in the electrical industry where I use blocks as device symbols and lines and polylines as wires connecting them.
Until now, I've stored information in visible or invisible block attributes.
I was looking for a way to store data for lines and polylines and here I came across xdata and this thread.
Generally I am looking for a way to create a common database in a drawing for all my items
In this aspect, I test the commands you have posted.
All XDTOOLS commands are useful to me.
I miss find-and-replace editing commands and arithmetic operations on numbers.
You would need some convenient interface to operate on data, for example in tabular form, but it's probably a matter of a dedicated application
In my industry, there are vertical Autodesk solutions such as Autocad MEP and Electrical, but they are not quite useful for me and I use the standard Autocad.
Thanks for the detailed answer.
Yes, I was thinking about a command for Find/Replace values in XData.
Might be able to add such a command in a little while.
And I also think the interface in tabular form for descriptive data is very useful.
But this seems to be impossible to do in lisp. It could definitely be done in ObjARX or Net. But we need to convince other programmers to do it. And there would be a problem with different versions of AutoCAD.
Perhaps it is better if you ask about it in the developers forum.
They may not listen to me there now.
Another command to test, XDTOOLS_REPLACEV - values replace in the specified XData field.
Shared archive of all XDTOOLS commands along with the command palette. Commands with corrections.
A development of the use of XData and a continuation of the XDTOOLS project is the XDLabel project.
The XDLabel project is experimental. Potentially extensible to other objects.
XDLabel linked drawing inscriptions to their objects, creates inscriptions, coordinates inscriptions with objects. Turns ordinary MText, etc., into an Attribute analog for any ordinary primitives.
XDLabel is designed to be analogous to the caption capabilities of vertical applications but does not create special objects, proxy. As valid in any AutoCAD.
Three commands now:
- linking inscriptions to their objects - XDLABEL_LINK,
- creation of inscriptions - XDLABEL_CREATE,
- update inscriptions - XDLABEL_UPDATEL.
The objects must already have XData attached, from whose fields the content of the inscriptions is taken or into which the content of the inscriptions is written.
These XDLabel commands are good to use together with the XDTOOLS tools.
There are 3-4 more XDLabel commands planned for better performance.
The speed and the variety of possibilities for working with inscriptions is noticeably better. There is no need to use dozens of small special programs.
Added XDLABEL_DTEXT command - creation of single single-line texts with links to objects.
XDLABEL_DTEXT repeats creating an ordinary Text + adding a link to the specified object + loading the Text content into the specified object's XData field. Or Text content is taken from the object's XData field.
Added XDLABEL_EDITDTEXT command - editing of single single-line texts with links to objects.
We haven't finished the XDLabel pilot subproject, but we are starting a second pilot subproject, XDPoint. XDPoint is a continuation of the idea of defining and using links between objects in basic AutoCAD. And a continuation of the XData tools and their use.
We start the subproject to clarify approaches, solutions, for defining links between objects of different types.
XDPoint - the definition and use of links of point-objects with other objects.
There are a lot of questions here too.
For example, what objects in this case it makes sense to consider as "point"? Only Points, Blocks?
All these projects are open, can take part in them.
And I wonder if there are any examples of defining objects links in basic AutoCAD? For application in general cases?
In the first approximation made three basic XDPoint commands - https://disk.yandex.ru/d/EdMbmZXGFn6lcQ:
- XDPOINT_CREATE - create point-objects for specified base objects and define their links,
- XDPOINT_LINK - link existing point-objects to their base objects,
- XDPOINT_UPDATEPT - update properties and position of point-objects relative to their base objects.
Unfortunately, the exact 3DSolid rotation can only be restored for 50% of cases.
More.
XDLabel commands are significantly fixed and improved - 37.
Added.
The command common to XDLink and XDPoint for selecting related labels and/or point objects is XDLINK_SINGLESEL. Performed for one specified object - for unambiguity.
See XDLink.fas.
The new version of XDLabel (see 37) adds XDLink commands for selecting objects and linked labels, possible errors of linking labels to objects. XDLINK_LINKSEL and XDLINK_SINGLESEL.
XDLabel commands are simplified - it is possible to create and link labels for objects without attaching XData to these objects.
Made it possible to perform all actions for many types of labels at once, without limitations.
Now almost all properties of labels are saved and restored.
Added possibility to create, update labels for 22 object properties - lengths, coordinates, areas, colors, layers, etc.
Etc.
There were and still are three basic commands in XDLabel:
- linking inscriptions to their objects - XDLABEL_LINK,
- creation of inscriptions - XDLABEL_CREATE,
- update inscriptions - XDLABEL_UPDATE.
But they are significantly improved.
Subprojects XDLabel, XDLink, XDPoint and the whole XDTOOLS project are still in progress.
And, it is still possible to participate in them.
Can't find what you're looking for? Ask the community or share your knowledge.