public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements) { UIApplication uiapp = commandData.Application; Document doc = uiapp.ActiveUIDocument.Document; try { Reference reference = uiapp.ActiveUIDocument.Selection.PickObject(ObjectType.Element); Element element = uiapp.ActiveUIDocument.Document.GetElement(reference); if (element.GetType().Name == "RevitLinkInstance") { linkedDocument = (element as RevitLinkInstance).GetLinkDocument(); using (TypeID typeID = new TypeID(uiapp, linkedDocument)) { typeID.ShowDialog(); } } else { TaskDialog.Show("Error", "Please Select Target Linked Model"); } /* * using (Selected_ID selected_ID = new Selected_ID(uiapp)) * { * selected_ID.ShowDialog(); * } */ return(Result.Succeeded); } catch { return(Result.Cancelled); } }