Search
 
SCRIPT & CODE EXAMPLE
 

CSHARP

get link element revit api

  UIApplication uiapp = commandData.Application;
            UIDocument uidoc = uiapp.ActiveUIDocument;
            Application app = uiapp.Application;
            Document doc = uidoc.Document;
			ObjectType obt=ObjectType.LinkedElement;
			Reference refElemLinked;
			Element linkedelement = null;
			
			refElemLinked = uidoc.Selection.PickObject(obt, "Please pick an element in the linked model");
                        RevitLinkInstance elem = doc.GetElement(refElemLinked.ElementId) as RevitLinkInstance;
                        Document docLinked = elem.GetLinkDocument();
						
						linkedelement = docLinked.GetElement(refElemLinked.LinkedElementId);
Comment

get linkinstance revit api

import clr
import sys
import System

clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
import Autodesk.Revit.DB as DB

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument

elements = UnwrapElement(IN[0]) if isinstance(IN[0],list) else [UnwrapElement(IN[0])]

dicDocLink = {link.GetLinkDocument().GetHashCode() : link for link in  FilteredElementCollector(doc).OfClass(RevitLinkInstance) }

OUT = [dicDocLink.get(elem.Document.GetHashCode()) for elem in elements]
Comment

PREVIOUS NEXT
Code Example
Csharp :: C# type where multiple 
Csharp :: string.format c# 
Csharp :: c# datafield change cell background color 
Csharp :: c# string interpolation float format 
Csharp :: how to navigate between page in wpf 
Csharp :: drop column with code first asp.net core 
Csharp :: is list sequential C# 
Csharp :: Running C# Example 
Csharp :: whining 
Csharp :: Microsoft.ACE.OLEDB.12.0 c# excel first sheet 
Csharp :: qget ViewSchedule revit api 
Csharp :: how to get text color alpha unity 
Csharp :: linqkit predicatebuilder or and nested combined predicates 
Csharp :: text mesh pro 
Csharp :: C# Move Camera Over Terrain Using Touch Input In Unity 3D 
Csharp :: unity how to change visual studio version 
Csharp :: c# avoid screensaver 
Csharp :: c# get the return value of a func 
Csharp :: lambda distinct by property 
Csharp :: unity eventtrigger blocks scrollview 
Csharp :: c# .net core kendo dropdownlistfor enum 
Csharp :: Focus on last entry in listbox 
Csharp :: how to change the scale of a gameobject in unity 
Csharp :: c# order by descending on 2 values 
Csharp :: C# oledb excel select column with space 
Csharp :: how to start commvault services on linux 
Csharp :: c# enum variable set to nonthing 
Csharp :: can you use unity for ftee 
Csharp :: ENUM error codes all 
Csharp :: c# how to convert string to float 
ADD CONTENT
Topic
Content
Source link
Name
6+3 =