Revit自适应族实例创建
一、类:
自适应是用于设计自适应填充图案构件的修改参照点,其族属于类内含以下几种运用方式:
四、自适应族创建:
//当前用户界面的文档UIDocument uiDoc = commandData.Application.ActiveUIDocument;//取得revit内部文档Document doc = uiDoc.Document;using (Transaction trans = new Transaction(doc)){trans.Start("创建自适应族");//获取自适应族类型FamilySymbol famSy= doc.GetElement(new ElementId(339728)) as FamilySymbol;//创建自适应族实例FamilyInstance fam = AdaptiveComponentInstanceUtils.CreateAdaptiveComponentInstance(doc, famSy);//获取自适应族的位置放置参照点IList<ElementId> placePointIds = AdaptiveComponentInstanceUtils.GetInstancePlacementPointElementRefIds(fam);//设置自适应放置点的位置ReferencePoint point1 = doc.GetElement(placePointIds[0]) as ReferencePoint;point1.Position = new XYZ(0, 100 / 304.8, 0);ReferencePoint point2 = doc.GetElement(placePointIds[1]) as ReferencePoint;point2.Position = new XYZ(500 / 304.8, 200 / 304.8, 0);ReferencePoint point3 = doc.GetElement(placePointIds[2]) as ReferencePoint;point3.Position = new XYZ(100 / 304.8, 500 / 304.8, 0);ReferencePoint point4 = doc.GetElement(placePointIds[3]) as ReferencePoint;point4.Position = new XYZ(0, 200 / 304.8, 100 / 304.8);trans.Commit();}
诚邀各位同仁加入福建BIM二开交流群(QQ群号:)与小编一起探讨二次开发相关内容,一起助力BIM信息化发展!