AutoCAD Architecture Customization
Welcome to Autodesk’s AutoCAD Architecture Customization Forums. Share your knowledge, ask questions, and explore popular AutoCAD Architecture Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PSD help for VBScript and MEP object model?

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
mdhutchinson
1552 Views, 5 Replies

PSD help for VBScript and MEP object model?

I am needing some help with accessing Object Model from Property Set Definitions... I've have done some in the past but I need a help file with the Object Model and its Methods, Properties, and Events...

(Although I don't believe the area of Prop Defs can use or act on Events.)

 

Can anyone point me to where I can get some help?

 

 

http://cadengineeredsolutions.com/undocumented-property-set-definitions-continued/

http://cadengineeredsolutions.com/category/property-sets/

http://blog.jtbworld.com/2007/01/adt-window-style-type-in-psd.html

 

5 REPLIES 5
Message 2 of 6

Hello,

 

Assuming you are looking for the object model in .NET, you will find reference documentation for All API in the AutoCAD Architecture API Reference (AcaMgd.chm) that you will find in the "\Help" folder. However, I could not find any comprehensive developer documentation for property set definitions. Sorry about this.

 

However, I found the next best thing. There are several blog posts on creating property set definitions for an object type and object in the ADN DevBlog:

 

http://adndevblog.typepad.com/aec/2012/09/attach-a-property-set-to-a-given-object-type-.html

 

http://adndevblog.typepad.com/aec/2012/09/attach-a-property-set-to-an-object.html

 

http://adndevblog.typepad.com/aec/2012/09/defining-a-property-set-definition-in-net-.html

 

http://adndevblog.typepad.com/aec/2012/07/how-to-set-a-classification-in-a-property-set-definition.h...

 

http://adndevblog.typepad.com/aec/2012/08/adding-a-property-set-programmatically-using-omf.html

 

http://adndevblog.typepad.com/aec/2012/08/adding-a-property-definition-to-a-property-set-definition-...

 

These posts should give you an idea of the object hierarchy and model for property set definitions.

 

Hope this helps.

 

Best Regards,

Gopinath

Message 3 of 6
Keith.Brown
in reply to: mdhutchinson


@mdhutchinson wrote:

I am needing some help with accessing Object Model from Property Set Definitions... I've have done some in the past but I need a help file with the Object Model and its Methods, Properties, and Events...

(Although I don't believe the area of Prop Defs can use or act on Events.)

 

Can anyone point me to where I can get some help?

 

 

http://cadengineeredsolutions.com/undocumented-property-set-definitions-continued/

http://cadengineeredsolutions.com/category/property-sets/

http://blog.jtbworld.com/2007/01/adt-window-style-type-in-psd.html

 


I believe that the information that you are looking for can be found in the VBA editor inside of Autocad MEP.  You might have to download it if you have not done so already.  A simple web search will return the download link.

 

Once you have fired up the editor, go into the tools menu and select references.  From there you will need to add a reference to the files that you will be looking at.  A good one would be the AEC Base 7.5 Application Library.  There might be several versions of the file that you wish to look at.  You will need to match up the version of the file with the version of Autocad that you are using.  You can use the link you posted to my outdated blog above to match the file version with the Autocad Version.

 

Once you have a reference to a file you can then go into the View Menu and select Object Browser.  In the upper left side of the dialog you can choose from the dropdown which file you would like to browse or you can just browse the entire library.  It is this dialog that will show you all of the methods and properties.

 

While it is possible to use these items in property set formulas as i have shown in my blog, i would instead recommend that you continue to transition to either vb.net or c#.  It is much more powerful and will allow you greater control over what you can do with the property sets.  It is true that the learning curve is much steeper and that it takes many more lines of code to do the same thing that one line of code in lisp or vba might do but in the long run it will be more beneficial.

 

The AutoCAD MEP/Architecture API has a full compliment of property set methods that will allow you to manipulate the information in any way you choose.  You can also create property sets on the fly but i have found that formula based property definitions are slow to create using code.  It is better to just create a master style drawing and clone the property set definition from one drawing to another.

 

I will warn you however that this is precious little information regarding the MEP or Architecture API.  The new ADN blogs do help but there should be more information available from autodesk.  To put it bluntly, their .net API is pretty horrible for autocad verticals.

 

Good luck and feel free to message me if you would like more information on .net.  With .net i have created an app that allows you to customize the information that you see in a tooltip for architecture and mep items.  It uses property sets to display information about the object.  So in short, if you can get the information inside of a property set then you can display it in a tooltip.  The resulting tooltip look and feels just like the real thing.  Below is a screenshot of the tooltip.

 

ToolTip.png

Message 4 of 6
mdhutchinson
in reply to: mdhutchinson

Thank you sooo much... I think this will do me well... just a little time to get to this with so many other things pushing this down the todo list.

Thanks!

Message 5 of 6
mdhutchinson
in reply to: Keith.Brown

Okay... I have VBA loaded for AutoCAD... and have some code written that seems to do what I was after. Granted it is only research at the moment... but when you run the code it prompts to select an AutoCAD MEP pipe object. It then returns promt and a msgbox with the connected MEP fittings name.

However, I wrote this last night and saved it... I thought it would save with the drawing file, but I saved it to my desktop. this morning I tried to open it...  the file extension is dvb... but it doesn't seem to load properly. I get some code that is in red... as if the file isn't compatable with VBA for AutoCAD.  Can you advise how I can get this back?

Message 6 of 6
mdhutchinson
in reply to: mdhutchinson

I found the answer...

I guess you do VBALOAD from the AutoCAD Prompt

It's been a long time since I did VBA.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost