Revit API

Reply
Active Member
FamhairCloiche
Posts: 8
Registered: ‎08-29-2012
Message 1 of 5 (392 Views)

Control DWF export color

392 Views, 4 Replies
11-29-2012 04:07 PM

I've written an external application (Xapp) to display the printable sheets in the document for user selection after which they specify an end folder.  I'm at AU so I'll be able to post the code later.  I pulled out the pertinent pieces from the SDK sample, and wired it into a form to fit our needs with a significant amount of post processing to deal with the arcane file naming system that our client is asking for.

 

What I've found is that the API method, ExportDWF(), creates documents that are in color to match the colors from the document rather than in black and white like when you use the native command; the black and white that we need.  I spoke with both Saikat and Jeremy Tammik about the issue so it's on their radars.  JT mentioned adding a process through the DWF API that I will look into next week.

 

In the meantime, has anybody else here already climbed this mountain?

Valued Contributor
Revitalizer
Posts: 79
Registered: ‎09-07-2012
Message 2 of 5 (376 Views)

Re: Control DWF export color

12-04-2012 06:03 AM in reply to: FamhairCloiche

Dear FamhairCloiche,

 

what about duplicating your views and overriding the colors in those copied views ?

If you export your copies instead of the original views, this may be a way to gain more control over the exporting process...

Haven't tested this yet, but just an idea.

 

Best regards,

Revitalizer

Active Member
FamhairCloiche
Posts: 8
Registered: ‎08-29-2012
Message 3 of 5 (373 Views)

Re: Control DWF export color

12-04-2012 07:06 AM in reply to: Revitalizer

I'll give that a shot today though I'm afraid that might be a lot more work actually unless there's a one-stop-shop to switch to monochrome that I don't know about.  Once upon a time all of our AutoCAD lineweights were color controlled, and when we first started the transition to REVIT several years ago the "executive paradigm" was less than informed about the differences between CAD and REVIT.  As a result our libraries are shot through with meaningless color for no better reason than that our new UI looks like our old UI.  Some of the color is embedded several layers down in the families, and in other places it's controlled through the project Line Styles as well as the Visibility Graphics.  We've begun to have some success reigning this in, but it's going to be a long road.

 

Just to clarify, the class that's giving me trouble is the DWFExportOptions.  I need a member property that controls the output color format.

Active Member
FamhairCloiche
Posts: 8
Registered: ‎08-29-2012
Message 4 of 5 (365 Views)

Re: Control DWF export color

12-05-2012 01:19 PM in reply to: FamhairCloiche

Found the fix with much help from Saikat!  The API Export to dwf method does not expose the property that defines that output as Color, Greyscale, or Blacklines.  Setting this property with the PrintManager class doesn't work for this method either.  What it does do however is read whatever the saved "Default" properties are under the:

 

R--->Export--->DWF/DWFx--->DWF Properties--->Print Setup.

 

Set and save the output criteria here and the API export will behave accordingly!

Employee
saikat
Posts: 185
Registered: ‎08-16-2007
Message 5 of 5 (357 Views)

Re: Control DWF export color

12-06-2012 01:26 PM in reply to: FamhairCloiche

Glad to know that you found the interim workaround useful.

 

Good luck!



Saikat Bhattacharya

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.