Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

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
Python :: pandas merge_asof direction 
Python :: how to kill python process started by excel 
Python :: utils/decorators.py", line 11, in __get__ raise AttributeError("This method is available only on the class, not on instances.") AttributeError: This method is available only on the class, not on instances. 
Python :: unocode error pytonn 
Python :: slug 
Python :: how to make hidden folders python 
Python :: gnuplot sum over a column 
Python :: Randome Word generator from consonant, vowel and specific string 
Python :: medium seaaborn mathplot diesign styles 
Python :: jupyter notebook morse code francais 
Python :: renpy quickstart 
Python :: tkinter yt downloader with resolution 
Python :: flatten a list of lists python 
Shell :: chrome remote debug 
Shell :: how to delete dangling docker images 
Shell :: what is --use-feature=2020-resolver 
Shell :: grep ip address 
Shell :: dotnet ef not found 
Shell :: git save password global 
Shell :: bash: gedit: command not found 
Shell :: conda install ipywidgets 
Shell :: ubuntu check how many cores 
Shell :: reload zshrc 
Shell :: ubuntu 20.04 install skype 
Shell :: remove git credentials terminal 
Shell :: upgrade plotly version 
Shell :: remove xampp from ubuntu 
Shell :: linux show version 
Shell :: how to install yup 
Shell :: rm is not recognized as internal command 
ADD CONTENT
Topic
Content
Source link
Name
8+7 =