trigger Property Dialog of a Family through API

trigger Property Dialog of a Family through API

Anonymous
Not applicable
1,324 Views
11 Replies
Message 1 of 12

trigger Property Dialog of a Family through API

Anonymous
Not applicable

Is it possible to trigger the Property Dialog of a Family through API ?

Or open the Type Property Dialog of the Assigned Family ?

QQ截图20160107162348.png

20160107164537.png

0 Likes
1,325 Views
11 Replies
Replies (11)
Message 2 of 12

Revitalizer
Advisor
Advisor

Hi,

 

UIApplication uiapp = commandData.Application;

RevitCommandId commandId = RevitCommandId.LookupPostableCommandId(PostableCommand.TypeProperties);

if(uiapp.CanPostCommand(commandId))
{
    uiapp.PostCommand(commandId);
}

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 3 of 12

Anonymous
Not applicable
but how can i pass the family to the dialog ? thank u
Message 4 of 12

Revitalizer
Advisor
Advisor

Hi,

 

you need to select an Element of the ElementType you want to display.

Edit the UIDocument.Selection before invoking the PostableCommand.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 5 of 12

arnostlobel
Alumni
Alumni

Just remember that posting the command should be the last thing your external command does in its Execute method.

Arnošt Löbel
Message 6 of 12

Anonymous
Not applicable

hi, Revitalizer

thank u for your reply,i have tried the UIDocument.Selection function to add a "wall" element to the UIDocument.Selection ,and then call the PostCommand method,it works well ,but i want the type property dialog to show a Family that i havn't  add a instance.i have tried the way below,but the dialog can't show.
Another question how to invoking the properties dialog by assigned family(specially havn't has instance for the family)? thank u

 

if (family != null)
            {
               
                //ISet<ElementId> familySymbolIds = family.GetFamilySymbolIds();

                List<ElementId> lelementIds = new List<ElementId>();
                lelementIds.Add(family.Id);
                uidoc.Selection.SetElementIds(lelementIds);


                RevitCommandId commandId = RevitCommandId.LookupPostableCommandId(PostableCommand.TypeProperties);

                if (uiapp.CanPostCommand(commandId))
                {
                    uiapp.PostCommand(commandId);
                }

}

0 Likes
Message 7 of 12

Revitalizer
Advisor
Advisor

Hi,

 

you need to have at least one Instance of your desired Family placed in your project.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 8 of 12

Anonymous
Not applicable
thank u.i get it
Is it possible to trigger the Property Dialog(the first image of my first post) ?
Message 9 of 12

Revitalizer
Advisor
Advisor

Hi,

 

PostableCommand.TogglePropertiesPalette

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





0 Likes
Message 10 of 12

Anonymous
Not applicable

thank u  but i wan to triger the properties dialog to react a new loaded family that havn't has any instance , like if if select a familysymbol in the Project Browser then the properties dialog react to the family.

20160108190447.png

Message 11 of 12

Revitalizer
Advisor
Advisor

Hi,

 

sorry, no more ideas.

Perhaps you can place a dummy instance in a temporary transaction after loading the family.

But I fear that if you delete it, the properties palette will react instantly and switch to another element's properties; having a void selection, this are the current view's properties.

 

I think, it's not possible.

 

 

Revitalizer




Rudolf Honke
Software Developer
Mensch und Maschine





Message 12 of 12

Anonymous
Not applicable
i will have a try ,also hope api open more interface to Access the system command and function thanks a lot ヘ(_ _ヘ)