Revit API to modify Insulation Layer Thickness

Source: Internet
Author: User

Start
[Transaction (TransactionMode. Manual)]
[Regeneration (RegenerationOption. Manual)]
Cmd: IExternalCommand
{
Result Execute (ExternalCommandData upload data, msg, ElementSet elements)
{
UIDocument uiDoc = upload data. Application. ActiveUIDocument;
Document doc = uiDoc. Document;
Selection selection = uiDoc. Selection;

Transaction ts = Transaction (doc,. ToString ());
Ts. Start ();
Reference refWall = selection. PickObject (ObjectType. Element ,);
Wall wall = doc. GetElement (refWall) Wall;
WallType wallType = wall. WallType;
CompoundStructure cs = wallType. GetCompoundStructure ();
BHas =; iWidth =; IList <CompoundStructureLayer> layers = cs. GetLayers (); (CompoundStructureLayer layers)
{
(Layer. Function = MaterialFunctionAssignment. Insulation ){
BHas =;
Layer. Width = iWidth /;
}
}
(! BHas ){
CompoundStructureLayer newLayer = CompoundStructureLayer ();
NewLayer. Function = MaterialFunctionAssignment. Insulation;
NewLayer. Width = iWidth /;
Layers. Insert (, newLayer );
}
Cs. SetLayers (layers );
WallType. SetCompoundStructure (cs );
Ts. Commit ();

Result. Succeeded;
}
} Url: http://greatverve.cnblogs.com/p/revit-api-CompoundStructureLayer.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.