Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone, I hope this message find you well.
In the last few days I have been work on a plugin that place interior elevations in the center of specifics rooms (bathroom and kitchen). Finally, I reached my goal, and the plugin worked perfect for my needs. But I have a probem, this plugin just works in model, but doesnt work in linked models. I'm missing some small detail about document access, do you guys have some clue?
Below you can see parts of my code, mainly about document access.
I appreciate your time, thanks.
namespace PlaceInteriorElevation
{
[Transaction(TransactionMode.Manual)]
public class Command5 : IExternalCommand
{
//Variables members
UIApplication _uiapp;
UIDocument _uidoc;
Document _doc;
public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
{
_uiapp = commandData.Application;
_uidoc = _uiapp.ActiveUIDocument;
_doc = _uidoc.Document;
FilteredElementCollector rCollector = RoomCollector();
////List all rooms.
//ListAllRooms();
///List all templates.
//ListAllViewTemplatesInCurrentDoc();
ViewFamilyType viewFamilyType = ViewFamilyTypeFilter();
if (viewFamilyType != null)
{
using (Transaction tx = new Transaction(_doc))
{
try
{
tx.Start("Command5");
//code continue...
tx.Commit();
}
catch (Exception e)
{
Debug.Print(e.Message);
tx.RollBack();
}
}
Solved! Go to Solution.