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

Unable to merge views using DWGEcportOptions

2 REPLIES 2
Reply
Message 1 of 3
d6222300060
255 Views, 2 Replies

Unable to merge views using DWGEcportOptions

I am trying to export all the active views in a sheet to a single dwg file. I have even set the merge option to true but still it doesn't merge it for me and export the views to different dwg files. it view returns me true once I set it equal to true but still it doesn't merge the views. any help will be appreciated. My code is as below:

 

import clr
import Autodesk.Revit.DB as DB
from Autodesk.Revit.DB import *
from System.Collections.Generic import List

doc = __revit__.ActiveUIDocument.Document

file_path = doc.PathName
export_folder = file_path[:file_path.rfind("\\")]

# Get the active sheet
active_sheet = doc.ActiveView
views_on_sheet = active_sheet.GetAllPlacedViews()

view_list = []
for view_id in views_on_sheet:
    view_list.append(view_id)
   
view_export_options = DB.DWGExportOptions()
view_export_options.MergedViews = True
   
output_file_path = "test.dwg"

views_collection = List[DB.ElementId](view_list)

doc.Export(export_folder, output_file_path, views_collection, view_export_options)
Tags (4)
Labels (2)
2 REPLIES 2
Message 2 of 3
jeremy_tammik
in reply to: d6222300060

Does it work for you manually in the end user interface? What options are you using there? Maybe there is something more that needs to be added?

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3
d6222300060
in reply to: d6222300060

I can do it manually in the end-user interface. But it doesn't preserve the shared coordinates. Even I select the option in the settings. That's why I tried to do it using the api.

d6222300060_0-1686124851041.png

 

 

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

Post to forums  

Forma Design Contest


Rail Community