Jump to content

Global Attribute Editor & Extractor


Lee Mac

Recommended Posts

Hi Lee,

 

i tried to run the program with acad2005:

 

The following error occurs:

 

** Error: no function definition: VLA-GET-ISDYNAMICBLOCK **

 

This seems normal to me, because there are no dynamic blocks in 2005.

 

So I believe your program works on releases =>2007 ?

 

regards

Wolfgang

Link to comment
Share on other sites

bug that i ran into is gone in v2.1! :D

new stuff is also cool.

bravo Lee!

 

Excellent :) thanks Cadigrac :)

 

I'll give a try

 

Thanks Lee

 

You're welcome, let me know how you get on :)

 

Hi Lee,

 

i tried to run the program with acad2005:

 

The following error occurs:

 

** Error: no function definition: VLA-GET-ISDYNAMICBLOCK **

 

This seems normal to me, because there are no dynamic blocks in 2005.

 

So I believe your program works on releases =>2007 ?

 

regards

Wolfgang

 

Ahh! nice spot Wolfgang, using 2010, I hadn't thought about Dynamic Blocks not being available in a few older versions.

 

I shall post an update shortly. :)

Link to comment
Share on other sites

Ahh! nice spot Wolfgang, using 2010, I hadn't thought about Dynamic Blocks not being available in a few older versions.

I shall post an update shortly. :)

 

 

Lee,

 

you will never get finish if you try to make your program compatible to some older versions....

...Shure, you can start with query the acad-version, than make some if-statements, doing all the "normal" code...

...but it's easy for me doing a upgrade to some higher acad-version :roll:

 

Maybee some people around here would appreciate a special "non-dynamic-block-version", but you started the coding with acad 2010.

That's why software-companys still sell new releases, though new features are rare. To me personally a acad2000 is still enough.

But if I choose to stay on a certain release, I can not blame any other person, if a given code don't run with acadxxx.

 

regards

Wolfgang

Link to comment
Share on other sites

Lee,

 

you will never get finish if you try to make your program compatible to some older versions....

...Shure, you can start with query the acad-version, than make some if-statements, doing all the "normal" code...

...but it's easy for me doing a upgrade to some higher acad-version :roll:

 

Maybee some people around here would appreciate a special "non-dynamic-block-version", but you started the coding with acad 2010.

That's why software-companys still sell new releases, though new features are rare. To me personally a acad2000 is still enough.

But if I choose to stay on a certain release, I can not blame any other person, if a given code don't run with acadxxx.

 

regards

Wolfgang

 

Actually, accounting for older versions isn't too bad - thats what vlax-method-applicable-p and vlax-property-available-p were made for :P

Link to comment
Share on other sites

I have updated the code to Version 2.2 - this should now work on 2005 Wolfgang.

 

Again, many thanks for the bug report - its difficult to account for everything. :)

Link to comment
Share on other sites

Lee What a great man you are

 

To me personally a acad2000 is still enough.

But if I choose to stay on a certain release, I can not blame any other person, if a given code don't run with acadxxx.

 

I Agree and I like ACAD2002, but the company where im working in has the higher versions ACAD2010

Link to comment
Share on other sites

Lee,

 

This program you developed is out of this world. WOW!!! What a time saver!!! I only wish I knew how you do it. My envy is building exponentially.

 

This program is awesome as is but if you’re looking for improvements below is a couple. The recommended changes I believe will help all. They do not relate to any one person rather how the program works. So the recommended changes are not tailoring this for me, but all.

 

 

 

 

A couple things I noticed off the bat;

  1. Version (V2.2) when loaded still says (V2.1)
  2. In the “Global Attribute Extractor” dialog box if you select the “Choose Tag…” button, up comes “Attributes to Extract” dialog box, you add the tags you want, Hit ok and the Tags are not added to the list of tags on the main “Global Attribute Extractor” dialog box.

globalattributeextracto.png

 

Recommended Improvements:

  1. Global Attribute Extractor:
    • If “All Tags” is selected for a particular block then have it list all the attributes being extracted instead of it stating “All Tags” and have the query list sort by block name. That way if you have multiple blocks with a lot of attributes listed it will keep it organized.
    • Have a header added for the list of queried blocks.
      • Block Name, Tag Name and Value. The “Value” column would be new. It would list the current text for that particular tag. This would be helpful when trying to identify what tag you are extracting or want to remove from the list.

[*]Move the “Add Block” and “Remove Block” buttons up under the block selection location.

[*]Add buttons for “Add Tag” and “Remove Tag” where the “Add Block” and “Remove Block” buttons where.

[*]Global Attribute Editor:

  • This dialog box can look identical to the “Global Attribute Extractor” with the addition of the tag updating section.
    • Add the “All Tags” selection option, “Choose Tags…” button, “Add Block” and “Remove Block” buttons, “Block Name” Header, “Tag Name” header and “Value” header.

    [*]Not sure how the “Block Name” and “Tag Name” are suppose to work in this dialog box. In order to load a tag in the query list a block name must be selected. However the two functions are not working together. You can pick a block and a tag from another block.

    • This dialog box can query tags the same as the “Global Attribute Extractor”. If “All Tags” is selected for a particular block then have it list all the attributes.
    • Once all the attributes are listed you can remove the ones you don’t need to change. You could then select the ones you want to edit and the “Block Name”, “Tag Name” and “New Value” section of the text editor will fill in for you. From there you could change the “New Value” and the “New Value” only. The “Block Name” and “Tag Name” should only list the value but the user should not be able to change them
    • It is also beneficial to list all the attributes for a block because a block can have a lot of attributes but only a few defined. So the ones that are not filled in will be blank and you have no way of selecting them. Your only option is to type the attribute name manually which could be time consuming to look up.

[*]Attributes to Extract:

  • Have a header added for the list of queried blocks.
    • Block Name, Tag Name and Value.

    [*]Change “Tag” to “Block Name” and add the section button so the user can pick the block.

    • Once you pick the block have it automatically load all the attributes. Then you can remove what you don’t need before you select ok and have it added to the query list.

Again all these recommended changes are merely nice to have. This program rocks as is and I have been using it since you first loaded it. Thanks again Lee for all your help and support.

 

Your friend,

Rob

Link to comment
Share on other sites

Hi Rob,

 

Many many thanks for your time spent reviewing the program, I am grateful of your comments and suggestions.

EXTRACTOR:

 

Version (V2.2) when loaded still says (V2.1)

Ahh yes - Version 2.2 was a quick fix for older versions - I think I may have updated it too quickly perhaps.

 

In the “Global Attribute Extractor” dialog box if you select the “Choose Tag…” button, up comes “Attributes to Extract” dialog box, you add the tags you want, Hit ok and the Tags are not added to the list of tags on the main “Global Attribute Extractor” dialog box.

Yes, these will not be added until you click to add the block to the main list - you can then double-click to edit them when in the list if you wish.

 

If “All Tags” is selected for a particular block then have it list all the attributes being extracted instead of it stating “All Tags” and have the query list sort by block name. That way if you have multiple blocks with a lot of attributes listed it will keep it organized.

The block list should already sort by block name - at least I put code in there for it to.

 

As for the tags being listed, there is a problem with this and a few of the other improvements you have suggested. This would only be possible if the block was in the current drawing. Otherwise ObjectDBX would have to be used to perhaps search for the block within another drawing - or for the block file itself... a lot of digging around and certainly not the quickest operation.

 

But, if the user has selected the block from the drawing, then certainly the tags can be listed.

 

Block Name, Tag Name and Value. The “Value” column would be new. It would list the current text for that particular tag. This would be helpful when trying to identify what tag you are extracting or want to remove from the list.

Again, this relies on having the block in the drawing - and of course, if it isn't, then what value would it display? The value of the attribute may (most probably will) vary from drawing to drawing, and it is not a quick process to look for it through all the drawings.

 

# Move the “Add Block” and “Remove Block” buttons up under the block selection location.

# Add buttons for “Add Tag” and “Remove Tag” where the “Add Block” and “Remove Block” buttons where.

But what would these 'Add Tag' and 'Remove Tag' buttons draw their information from? The functionality for this is inbuilt into the 'Choose Tag' button, so I think it would complicate it to have these buttons on the main dialog.

 

I really wanted to keep the main dialog focussed on which blocks to extract from, and then have the 'sub-dialog' "Attributes to Extract" to determine which attributes to read from each block.

 

EDITOR:

 

  • This dialog box can look identical to the “Global Attribute Extractor” with the addition of the tag updating section.
    • Add the “All Tags” selection option, “Choose Tags…” button, “Add Block” and “Remove Block” buttons, “Block Name” Header, “Tag Name” header and “Value” header.

    [*]Not sure how the “Block Name” and “Tag Name” are suppose to work in this dialog box. In order to load a tag in the query list a block name must be selected. However the two functions are not working together. You can pick a block and a tag from another block.

    • This dialog box can query tags the same as the “Global Attribute Extractor”. If “All Tags” is selected for a particular block then have it list all the attributes.
    • Once all the attributes are listed you can remove the ones you don’t need to change. You could then select the ones you want to edit and the “Block Name”, “Tag Name” and “New Value” section of the text editor will fill in for you. From there you could change the “New Value” and the “New Value” only. The “Block Name” and “Tag Name” should only list the value but the user should not be able to change them
    • It is also beneficial to list all the attributes for a block because a block can have a lot of attributes but only a few defined. So the ones that are not filled in will be blank and you have no way of selecting them. Your only option is to type the attribute name manually which could be time consuming to look up.

The Editor can currently only update attributes for a single block - merely because I wanted to make the main list box on the dialog displaying the tag and the new value for the tag.

 

Hence, if each block had multiple tags to update, this would be difficult to display whilst still allowing the user to enter new tags and new values.

 

I shall, however, allow only attributes of the entered block to be selected - as this was indeed the desired functionality, I just must've forgot to code it in...

 

Again, the attribute list can only be displayed if the block is present in the current drawing. But this could be incorporated if the user selects the block.

 

Attributes to Extract:
I think I shall add a field for block name, but I'm not sure whether to have it populate the attribute list - perhaps have the 'select tag' in a loop so that multiple tags can be selected.

 

I shall think about this one.

 

 

________________________________________________________________________

 

 

Again, many thanks for your suggestions - I'm sorry if it seems that I have said that most are too difficult or would make it too complicated, but there are a few in the list that I shall incorporate in the near future.

 

I'm glad that you like the program and that it will save you time.

 

Cheers,

 

Lee

Link to comment
Share on other sites

Lee,

The way I see it; you spent all this time developing this awesome program the least I could do is spend the time reviewing it and provide you with feedback. As I stated they were merely opinions of improvement that I thought all would benefit from. Thanks again for being so kind and sharing to the world your expertise of programming.

Rob

Link to comment
Share on other sites

I have updated the code to Version 2.2 - this should now work on 2005 Wolfgang.

 

Again, many thanks for the bug report - its difficult to account for everything. :)

 

Lee,

 

thank you for changing the code.

 

It's an amazing program!

 

I checked it just the moment, running through a directory with 116 MB of dwgs, each one of ~ 15 MB size.

Extracting a title block (10 layouts with title block per drawing) on this directory, it took only 1 minute!!!

 

regards

Wolfgang

Link to comment
Share on other sites

Lee,

 

thank you for changing the code.

 

It's an amazing program!

 

I checked it just the moment, running through a directory with 116 MB of dwgs, each one of ~ 15 MB size.

Extracting a title block (10 layouts with title block per drawing) on this directory, it took only 1 minute!!!

 

regards

Wolfgang

 

That's superb Wolfgang! Thanks :)

 

I have only tested it on two or three small drawings, but its great to know that it can handle drawings of that size. I suppose that just demonstrates the power of ObjectDBX over running a script to do the same thing.

 

Did everything run smoothly, were the attributes extracted/written correctly for this amount of drawings? *just curious* :)

 

I'm glad you like the program Wolfgang :)

 

Lee

Link to comment
Share on other sites

Following Rob's suggestions I have updated the first post to Version 2.3.

 

In this version:

 

  • The Get_Unique function (used for sorting attributes) has been upgraded, meaning a 40% increase in speed for this function.

  • In the Extractor, when selecting blocks from the drawing, their attributes will be displayed instead of just "ALL TAGS", making it easier to edit which to extract.

  • In the Extractor, then double-clicking on an entry to edit it, you can now also edit the block name.

  • In the Editor, you can now only select tags that belong to the block entered - making the functionality much more consistent. And the current value for the selected tag is shown in the 'New Value' field, so that it is quicker to change, if only a small edit is needed.

  • In the Editor, when selecting a block from the drawing all Attributes with their current values are listed, making it quicker than selecting/entering each one individually.

As always, your feedback is welcome, and any bug reports :)

 

Enjoy,

 

Lee

Link to comment
Share on other sites

and have the query list sort by block name.

 

Although the query list sorts by block name, I'm wondering whether I should make the Blocks in the Excel file be sorted by block name also... :wink:

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...