Help regarding full explode.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello Forum,
I am exploding .dwg file in revit .
my code is working for partial Explode but it is not working for Full Explode.
Below is sample code:
Working:
public void PressDWGExplodeButton()
{
try
{
AutomationElement mainWndFromHandle = AutomationElement.FromHandle(m_application.MainWindowHandle);
//AutomationElement mainWndFromHandle = AutomationElement.FromHandle(System.Diagnostics.Process.GetCurrentProcess().MainWindowHandle);
PropertyCondition nameRibbonCondition
= new PropertyCondition(
AutomationElement.NameProperty,
"Explode");
PropertyCondition typeRibbonCondition
= new PropertyCondition(
AutomationElement.ControlTypeProperty,
ControlType.Custom);
AndCondition andCondition
= new AndCondition(
typeRibbonCondition,
nameRibbonCondition);
var ribbonWnd = mainWndFromHandle.FindFirst(
TreeScope.Descendants, andCondition);
var a3 = mainWndFromHandle.FindAll(TreeScope.Descendants, andCondition);
PropertyCondition aIDCondition
= new PropertyCondition(
AutomationElement.AutomationIdProperty,
"Dialog_Essentials_ImportInstanceExplode:Control_Essentials_ImportPartialExplode_RibbonListButton_FlyoutButtonExecute");
var fullExplodeButton = ribbonWnd.FindFirst(TreeScope.Children, aIDCondition);
InvokePattern invPattern = fullExplodeButton.GetCurrentPattern(InvokePattern.Pattern) as InvokePattern;
invPattern.Invoke();
Class2.exploded = true;
}
catch (Exception ex)
{
}
}
Journal file :
partial explode:
Jrn.PushButton "ToolBar , {}{} , Dialog_Essentials_ImportInstanceExplode" _
, "Partial Explode, Control_Essentials_ImportPartialExplode"
Full Explode:
Jrn.PushButton "ToolBar , {}{} , Dialog_Essentials_ImportInstanceExplode" _
, "Full Explode, Control_Essentials_ImportExplode"
I have changed condition and I am getting fullExplodeButton null;
PropertyCondition aIDCondition
= new PropertyCondition(
AutomationElement.AutomationIdProperty,
"Dialog_Essentials_ImportInstanceExplode:Control_Essentials_ImportExplode_RibbonListButton_FlyoutButtonExecute");