TheSwamp

Code Red => VB(A) => Topic started by: commodore on January 27, 2009, 07:14:49 AM

Title: MEP2008 How do I import a style from another project/drawing
Post by: commodore on January 27, 2009, 07:14:49 AM
I'm using MEP 2008
I'm looking for some code or guideance on how to import styles from another drawing into my current drawing.
I still a VBA beginner so type slowly please :-) 
Title: Re: MEP2008 How do I import a style from another project/drawing
Post by: Matt__W on January 27, 2009, 08:29:35 AM
Doing it by code is difficult (if not impossible).

Your best bet would be to use the STYLE MANAGER and open a drawing that has the styles you want to copy and do it that way.  Or you can create a DWG that contains all of your default styles and then simply insert that drawing.  The insert method will NOT prompt you to overwrite existing styles.  It will only bring in those that do not exist in the current drawing.  The last method would be to use the CAD STANDARDS and synchronize your project settings.
Title: Re: MEP2008 How do I import a style from another project/drawing
Post by: commodore on February 26, 2009, 11:32:29 AM
Turns out its not impossible nor difficult
http://discussion.autodesk.com/forums/thread.jspa?messageID=581633&
(make sure you reference the AutoCAD/ObjectDBX Common Type Library)
Thanks Bobby!
Title: Re: MEP2008 How do I import a style from another project/drawing
Post by: jbuzbee on March 12, 2009, 12:37:03 PM
Commodore,

A couple of issues with importing styles with ObjectDBX:  Property sets, Materials and classifications attached to objects do not import cleanly.  If a classification exists, it is ignored and a new one is created "myDoocClassification(2)". 

I use a different approach which works on everything but classifications.  I open the host document via objectdbx and via activex create a block with the object added in question.  Then I use objectdbx to import the block into the active drawing.  I don't know why this works: perhaps it's because the AEC object was already created.  Dunno.

I stopped using classifications for this reason.  I haven't checked if this has changed in 2009 - if I get some time I might.

Just thought I'd give you a heads up.