Anuncios
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Explode dwg API / PostableCommand

Anonymous

Explode dwg API / PostableCommand

Anonymous
No aplicable

Hello,

With Revit 2018, I still can't find a way to explode a dwg. I've seen that this has been a request from 2015 at least, but it seems that there is no method / PostableCommand related to this.

Do we have a workaround?

Thanks,
DA ROCHA Romain

0 Me gusta
Responder
2.030 Vistas
8 Respuestas
Respuestas (8)

jeremytammik
Autodesk
Autodesk

Dear Romain,

 

I would assume that you can use PostCommand to drive this command.

 

I am afraid I am not aware of any direct API call yet, sorry to say.

 

Have you checked whether this wish is also listed and voted for in the Revit Idea Station?

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Me gusta

Anonymous
No aplicable

I tought of PostCommand too, but I can't find any enum value related to "explode" or "ImportInstance".
I'll take a look if it is present in the wish list.

0 Me gusta

Anonymous
No aplicable

I'll explain what I trying to do, there might be other ways to solve my problem.

I'm currently trying to retreive specific data from a layer in an imported dwg file. Right now, I wanted to delete all unnecessary layers (I managed to do it), and then explode what's left (I didn't find a way to do it)

 

On the other way, I can also find polylines by parsing the geometry element of my import instance. But i'm missing the text data. Is there a way to get them?

0 Me gusta

kevin.anggrek
Enthusiast
Enthusiast

Hi all,

 

It is 2020 and I am using Revit 2020.

Does anyone know the workaround to this issue?

 

As far as my understanding goes, PostCommands can be used to activate commands by the RevitCommandId found by either using the LookupCommandId or LookupPostableCommandId Method

As said by @Anonymous , no commands related to exploding a DWG or CAD is available in the PostableCommand Enumeration and thus I cannot use the LookupPostableCommandId

 

By looking at the Revit journal as inspired by Mr. Tammik's post: Programmatic Custom Add-In External Command Launch, the closest I would get to the explode button is "Dialog_Essentials_ImportInstanceExplode" which I thought must be the command name for the Explode command. However, implementing the following code returns an argument exception saying that: 'The commandId must be in Autodesk.Revit.UI.PostableCommand or an external command.'

 

UIApplication uiapp = commandData.Application;
UIDocument uidoc = uiapp.ActiveUIDocument;
Document doc = uidoc.Document;

uiapp.PostCommand(RevitCommandId.LookupCommandId("Dialog_Essentials_ImportInstanceExplode"));

 

 

As for the voting to the Revit Idea Station, the wish was raised previously but due to inadequate number of support from the community, the wish was not pursued and the post was since archived.

 

Should I go back to UI automation? or does anyone know the command name or Id required for the explode command?

 

Thank you

samuel.cailletMDQ7N
Enthusiast
Enthusiast

The topic has been archived, however, a solution would be appreciated...
https://forums.autodesk.com/t5/revit-ideas/explode-api-access-dwg/idi-p/6637323

0 Me gusta

jeremy_tammik
Autodesk
Autodesk

I guess the most efficient way forward with this might be to raise a new wish in the Revit Idea Station, point to the old one, and add many more new votes to get it approved this time around.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open

eobimoffice
Observer
Observer

Hi there from year 2023 and Revit 2024! I have the exact same problem that others from previous years. I can't find the explode "RevitCommandId" to run the "PostCommand" method. Does somebody has figured out what is the "RevitCommandId" of the "Explode" command? 

This command is totally essential for automated tasks with DWG files, it's a shame that we have so little information about it.

The Revit journal wasn't of help neither. Help is it's content:

'E 12-May-2023 14:21:14.776; 0:<
Jrn.PushButton "ToolBar , {}{} , Dialog_Essentials_ImportInstanceExplode" _
, "Full Explode, Control_Essentials_ImportExplode"

'H 12-May-2023 14:21:14.810; 1:<
Jrn.Data _
"Transaction Successful" , "Explode Import Instance"

' 0:< <<Begin build CT>>
'

'Edit mode: IDR_COMMON

'Command:

'Category: 0

'Bar list:
' Dialog_Revit_DynamicLabelDBar
' Dialog_Essentials_FilterSelectionNew
' Dialog_Essentials_ImportInstanceExplode

I have almost no experience reading Revit Journals, but I can notice that the Command line is empty, while previous and latter command indicate their corresponding "RevitCommandId".

Somebody help please!