Hi,
My Background
I’m new to coding both for creating custom nodes for Dynamo and in generally. I have some experience with C# in Grashopper for Rhino, however I mostly created calculation nodes. I have considered Zero Touch by YouTube-videos from “Simply Complex” and “Danny Bentley”. Furthermore, I have become acquainted with the homepages “GitHub” and “thebuildingcoder”.
Problem
I’m trying to create a custom node like ClockWork: FamilyType.SetCompoundLayerWidth, because I cannot get it to work (Dynamo 1.3 and Revit 2018). I would like to create it by C# (Zero Touch), as described in My Background I have some knowledge about this language and I to some degree can get help from a friend. As a reference I have looked at: CmdNewWallLayer.cs from thebuildingcoder.
The problem I’m having is that in terms of my limited knowledge the only inputs from Dynamo to a custom node in this case is Revit.Elements.
XXX. However, in order to alter the thickness of a layer by CompoundStructure
it needs to by Autodesk.Revit.DB.
XXX. By trying various things I quickly found out that you can’t set Revit.Elements.WallType
equal to Autodesk.Revit.DB.WallType
(?) . I then tried to use the information from “Intro to Zero Touch 202(creating a custom node that gets a Revit Element ID)” to maybe search by
ElementId
etc. Some examples of what I have tried is shown here ( sorry for the quality in advance ):
public static void GetWall(Revit.Elements.WallType element, double LW, int LI)
{
Autodesk.Revit.DB.WallType type;
type = element;
Autodesk.Revit.DB.CompoundStructure CS = type.GetCompoundStructure();
CS.SetLayerWidth(LI, LW);
type.SetCompoundStructure(CS);
}
public static void Test4(Revit.Elements.Element element)
{
Autodesk.Revit.DB.Element UnW;
UnW = element.InternalElement;
if (UnW is Autodesk.Revit.DB.WallType)
{
Autodesk.Revit.DB.CompoundStructure CS = UnW.GetCompoundStructure();
CS.SetLayerWidth(LI, LW);
UnW.SetCompoundStructure(CS);
}
Questions
- Can anyone maybe help my in the right direction to convert
Revit.Elements.WallType
toAutodesk.Revit.DB.WallType
? - Maybe in general how to convert wrapped Dynamo Elements to Revit Elements (vice versa)?
In terms of what I have understood by Pyhton Script this is solved by UnwrapElement
- So is more sensible I learn Python?
Or
- Is their some basic information that is necessary to know, that I did not find by my own search on the web?
Thank you for any help you can give.