Tag: akn_include

  • RevitAPI: FamilyManager.Set – InvalidOperationException and get members from AssemblyInstance

    中文链接 By Aaron Lu Q: Would you please confirm it is not allowed to set value family parameter if there is no type? In Family Editor, when calling FamillyManager.Set(FamilyParameter), it will throw InvalidOperationException: There is no current type the code looks like this: var para = RevitDoc.FamilyManager.AddParameter(“Length”, BuiltInParameterGroup.INVALID, ParameterType.Length, false); RevitDoc.FamilyManager.Set(para, 123.1); It allows us…

  • Security Object

    The Security object contains some utility functions dealing with users, groups and roles. And we have seen the examples using its loadUser() and loadGroup() functions. We are going to see what else the Security object has.

  • Item Object: Master Property

    Master is one property of Item object. It contains the item’s DMS ID, workspace ID, owner, additional user owners and additional group owners. In this post, we will go through each of them.

  • RevitAPI: Create FamilyInstance on a wall face

    中文链接 By Aaron Lu A customer has a headache to create family instance on wall, he tried several combinations of Document.Create.NewFamilyInstance but got nothing. Here is what he wants, place a light fixture on wall: I found when we place them by manual, it is always on a face of the wall, so we can…

  • Item Object: Fields

    Today let’s put spotlight on the item fields. First we will see how to access each field from the Item object. Then we will go through all field types and find the corresponding value type in scripting for each of them.

  • RevitAPI: Create dimension on detail component

    中文链接 By Aaron Lu Below are 2 detail components, each is actually a detail line in the family. What dimension we want to create is like this: We know the Document.Create.NewDimension method is: Dimension NewDimension(View view, Line line, ReferenceArray references) First 2 arguments are easy: one is the view to create on, the other is…

  • RevitAPI: PipeScheduleType is missing for a rte file

    中文链接 By Aaron Lu I’ve gotten a strange problem for Revit 2015, in the project file created from a rte file sent from a customer, there is no PipeScheduleType at all, which means all PipeType.Class is null, even if there are a lot of pipe segments in the document. After communicating with developer, we confirmed…

  • Item In Script

    Item object is the representation of an item in scripting. In this post, I will show you how to load, create, and delete an item.

  • Detecting Ribbon Panel Visibility Change

    By Madhukar Moogala I’ve received a query from an ADN partner on how to get notified when Ribbon panel visibility is changed. Here is a self explanatory code, all we need is to listen to IsVisibleChanged event. private const String TAB_ID = "ID_CUSTOMCMDS"; [CommandMethod("addRibbon")] public void addRibbon() { Autodesk.Windows.RibbonControl rbnCtrl = RibbonServices.RibbonPaletteSet.RibbonControl; RibbonTab rbnTab =…

  • RevitAPI: How to get view position in sheet

    中文链接 By Aaron Lu View inserted into Sheet will become Viewport, when we select the view port, snoop it with RevitLookup, we can see: So how to get its location? After looking at RevitAPI.chm, we can find there are 3 relevant methods: //Returns the center of the outline of the viewport on the sheet, //…