Jump to content

New to VBA - Global attribute edit


GegH

Recommended Posts

So new in fact it all looks very confusing.

 

I have a script to run global Attribute edit

 

Command: -ATTEDIT

Edit attributes one at a time? [Yes/No] : N

Edit only attributes visible on screen? [Yes/No] : Y

Enter block name specification : Tree

Enter attribute tag specification : PlantID

Enter attribute value specification :

1 attributes selected.

Enter string to change: .

Enter new string:

 

this runs off a icon ^c^c^c_-attedit;n;y;tree;plantid;;\;;\;

 

I am trying to run it from a VBA form, activated by the icon.

Firstly I would like it to replace the whole string to change regardless of what is entered there, if that is possible.

The form would also have a text box to enter the new string if you know it (as a code), and a browse button if you don't.

Clicking the browse button would open a second form that is connected to a database (Plant.mdb) which has plant names and codes that you can select. on selection it fills out the text box for you.

 

As i say, i am new to this and can't even get VBA to run the basic script, which would be a good start to my learning curve.

 

All help is greatly appreciated

Link to comment
Share on other sites

Serach the posts here under BIGAL I have posted a few times a simple VBA code for changing the attributes for a given block name no matter how many or where in a dwg.

 

"BIGAL" "Attributes"

Link to comment
Share on other sites

The idea would be to insert the Plant Code but to identify the code by choosing the Latin name (Plant Name) and/or Common Name, my latin is terrible. I will probably end up filtering/querying the database by Shrub, Tree, Groundcover, etc... but if i understand the code i will do this later.

DatabaseScreenshot.jpg

 

Thankyou so much for your help, i am going nowhere fast.

TreeBlockExample.dwg

Link to comment
Share on other sites

Sorry Fixo, I have been a little pre occupied over the last few days with a bit of an earthquake in Christchurch.

Our house is fine, so is the family, but we thought it prudent to leave the area for a little while.

At the moment i am in Australia for a week and have only just managed to get online.

Thankyou for your help and work, i will take a look tomorrow and see if i can make it work.

Link to comment
Share on other sites

Sorry Fixo, I have been a little pre occupied over the last few days with a bit of an earthquake in Christchurch.

Our house is fine, so is the family, but we thought it prudent to leave the area for a little while.

At the moment i am in Australia for a week and have only just managed to get online.

Thankyou for your help and work, i will take a look tomorrow and see if i can make it work.

Oh, man

Glad The God blesssed your family

I've watched TV about this ugly trouble, very sorrowed indeed

But...no worries,

Let me know if something is wrong in there,

still waiting for,

 

Regards,

 

Oleg

Link to comment
Share on other sites

Thankyou for your kind thoughts, it is quite upsetting to see such a beautiful city so desimated and with such a loss of life.

 

I had a go with the App, it seems when i click 'Apply to Blocks' a dialogue box opens telling me to try other block.

 

I did find another command 'GATTE' which is essentially what i need to do:

Command: gatte

Initializing...

Select block or attribute [block name]:

Known tag names for block: PLANTID

Select attribute or type attribute name:

Block: Tree Attribute tag: PLANTID

Enter new text: AcBr

Number of inserts in drawing = 7 Process all of them? [Yes/No] : NO

Select objects: Specify opposite corner: 4 found

Select objects:

Please wait...

4 attributes changed

 

But rather than typing the new Code, we pick it from the list in your dialogue box.

I'm not sure if this makes the task simpler or not.

 

I really appreciate your help with thisAttEditWin.jpg

AttEdit.jpg

Link to comment
Share on other sites

I'm pretty sure you'll restore this nice town and all the buidings you've loved before

Not so quick of course, anyway

Ok, back to App, what I understand from your explanation: you want to add possibility

to change all blocks or just the blocks that you've selected on screen

Think in this case we need to drop on form 2 radio buttons for that

Am I right?

Link to comment
Share on other sites

More often than not it will be selecting certain blocks on the screen.

Designers are a flaky bunch who constantly change their minds, and clients tend to not know their minds until you're on site.

The radio buttons sound like a great idea.

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...