AutoCAD Architecture MVBlock Attribute Editing

AutoCAD Architecture MVBlock Attribute Editing

dennis
Advisor Advisor
1,447 Views
8 Replies
Message 1 of 9

AutoCAD Architecture MVBlock Attribute Editing

dennis
Advisor
Advisor

I was digging through the forums about this, and found that this may not be possible anymore.  But, I wanted to confirm.

I have been tasked to update some Lisp code, where one routine for ADT2002 used entget to collect the attribute data of a MVBlock tag, and if a certain user entry is "one thing" then it changes it to "the other thing".

Now in ACA2016, this can be done manually by selecting the mvblock tag and then going to Properties/Attributes.  But, they want the Lisp to do it.  I haven't been able to find much code on this specifically, and several posts saying it isn't even possible, though admittedly, those posts are a few years old.

I found a few lines of Visual Lisp calls that the dump gave some data, but still wasn't down to the attribute data level.  This particular attribute is not driven by PropertySets, it is completely open for the user to modify.

Can anyone confirm that "it can't be done anymore" or if it is possible, how?  I am open to shifting to VBA, or .NET.  I would prefer, if I need to rewrite, to write it in C#.NET anyway.

0 Likes
Accepted solutions (1)
1,448 Views
8 Replies
Replies (8)
Message 2 of 9

dbroad
Mentor
Mentor

Tags pull data from the objects they track via property sets.  Having a lisp program change the tag values without changing the underlying data seems like a really bad idea.  The next time a regeneration occurs, the mvblock tag will refresh the data pulling information from the AEC object it tags.

 

If you want a cooperative effort, post the LISP programs that don't seem to work along with an ACA drawing that contains objects and tags.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 3 of 9

dennis
Advisor
Advisor

The actual attribute data I want to edit is not driven by Property Set Data.  In the old 2002 code, entget would show the attribute data in assoc list 305.  Now it doesn't.  However, if I select the mvblock, in the Properties Design Tab Advanced Section there is a pick for the Attributes, there I can manually change.  The attributes that are driven by Property Set Data are 'greyed' so they can't be selected.  As well, on the Extended Data tab, the particular attribute I am trying to change is not even listed.  So, I am not trying to change Property Set Data.

Somehow, the attribute data is accessible for the user to change, as demonstrated manually through the Properties palette.

I have attached a dwg, saved in ACA2016.

0 Likes
Message 4 of 9

dennis
Advisor
Advisor

HELLO?!  Is there anyone out there??

0 Likes
Message 5 of 9

dbroad
Mentor
Mentor

As I explained before, all of your attributes are set up to automatically fill from the property set(s).  All the properties are automatic or formula driven except for the description property.  You cannot or should not change property set data through a tag. Change it through the window object.  LISP programs for these tasks are a bad idea IMO.  There is no guarantee that the way data is stored internally by ACA will not change from version to version.  They were never intended to be available via LISP and must be hacked to work at all.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 6 of 9

dennis
Advisor
Advisor

dbroad....as I explained to you twice.  The particular attribute is not driven by Property Set Data.  Have you even bothered to check the dwg I have posted?

0 Likes
Message 7 of 9

dbroad
Mentor
Mentor
I exploded the tag twice and looked at the attribute definitions. They are all clearly set up to be automatically populated from the property sets. I'm going to let someone else step in and help you as you do not seem to appreciate my input.
Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 8 of 9

dennis
Advisor
Advisor

dbroad:

I too exploded twice and checked the Properties.  Clearly NOT ALL the attributes are Property Set Driven.  The first few attributes contain the colon character between the object's type (WINDOW) and the name of the Property Set Data.  The last two attributes do not contain this colon structure, making me believe that those two attributes are open for user entry. I have attached a PDF of my evaluation.  Feel free to correct me if I am wrong in my evaluation.

However, if you prefer more to feigned indignation that someone would question your answer, feel free to "step aside".  I would like an answer with explanation, rather than just an edict.

 

So, back to my original question, is there a way either in AutoLISP, VBA, or .NET to access these attributes?  I think there must be since Autodesk has provided access via the Properties Palette within ACA.

0 Likes
Message 9 of 9

dennis
Advisor
Advisor
Accepted solution

Thanks to the Development Team at Autodesk, specifically Eswar.  I now have direction.  As I expected, the programming is a bit "out of reach" for AutoLISP/Visual LISP.  But is doable via .NET and clearly not a hack process at all.  The basic steps are outlined below if you are interested in learning:

1) You will need to add the References for AecBaseMgd

2) Get the Object ID of the MVBlock tag

3) Get hold of the MultiViewBlockReference object: AecDB.MultiViewBlockReference

4) The MVBlockRef will give access to the MultiViewBlockViewInstance

5) Index thru the available MVBViewInstances for the one containing the user editable Attribute (note is will not have PropertySet reference)

6) From there, standard AutoCAD .NET API to modify the value.

 

I am now writing the specific code.  Since it will be C#.NET I will post the code in the .NET forum when completed.

0 Likes