dbroada Posted June 1, 2011 Share Posted June 1, 2011 If I have a block with a single attribute can I access the attribute by name.... myAttributes = myObject.GetAttributes myName = myAttributes("Title").TextString rather than myAttributes = myObject.GetAttributes myName = myAttributes(0).TextString obviously I'm asking as my blind stubbling about has failed to reveal a solution. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 8, 2011 Share Posted June 8, 2011 I just asked the opposite question in the lisp forum at a guess your asking for tag name maybe something like myName = myAttributes(0).TagString this is a guess, I actually found it easier though to just use position (x) rather than tag name as a tag name can be changed then code will not work. Does the vba prompt give options as you type code ? Quote Link to comment Share on other sites More sharing options...
dbroada Posted June 8, 2011 Author Share Posted June 8, 2011 I saw that you were asking and wondered if you would be back here. I was asking off the back of a quick and dirty routine I knocked up last week. Having completed my drawing somebody up the food chain decided that the cables should be prefixed with the name of the device they were connected to. I had used a single attributed block for both cable number and source device so it was a simple matter of reading attribute(0) from one block and writing to attribute(0) in the otehr block but I then started thinking about what if there had been 3 attributes, and what if different blocks had the same information but at different locations. It would suit me if I could use attribute("DeviceNumber") rather than step through untill the match was made. You do get options in VBA but typical of microsoft, you only get the ones you know about and the others are only exposed when you have made a good enough guess. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted June 19, 2011 Share Posted June 19, 2011 the answer was staring at us`my guess was right myName = myAttributes(0).TextString attrib value myname = myAttributes(0).TagString attrib tag Quote Link to comment Share on other sites More sharing options...
dbroada Posted June 19, 2011 Author Share Posted June 19, 2011 thanks, I'll have a look tomorrow (if I remember). Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.