完善主体资料,免费赠送VIP会员!
* 主体类型
* 企业名称
* 信用代码
* 所在行业
* 企业规模
* 所在职位
* 姓名
* 所在行业
* 学历
* 工作性质
请先选择行业
您还可以选择以下福利:
行业福利,领完即止!

下载app免费领取会员

NULL

ad.jpg

revit异形柱怎么画?从CAD翻模来解决问题!

发布于:2020-09-22 14:39:10
首页/BIM专题
分享

问题:咋直接根据CAD图纸进行异形柱翻模?

  • 解决难点1:获取CAD异形柱信息,创建异形柱族。

  • 解决难点2:异形柱族加载进项目时的位置点是(000)及坐标转换。

解决问题:

根据CAD图纸进行柱子翻模,其中异形柱翻模最为关键,而异形柱根据轴网放置往往不能满足要求,我的解决办法是根据其重心作为它的LocationPoint,然后对柱子形状进行判断,最后放置即可。

这里只阐述异形柱翻模最核心的部分,就是根据CAD图纸创建的族的重心移动到(000)位置,效果如下:

其轮廓坐标点:(10/304.8,0,0)(10/304.8,20/304.8,0)(20/304.8,20/304.8,0)(30/304.8,10/304.8,0)(30/304.8,0,0)

腿腿教学网-revit异形柱怎么画?从CAD翻模来解决问题!

代码:

Autodesk.Revit.ApplicationServices.Applicationapp=commandData.Application.Application;

stringrftpath=@"C:\ProgramData\Autodesk\RVT2019\FamilyTemplates\Chinese\公制结构柱.rft";

DocumentfaDoc=app.NewFamilyDocument(rftpath);

using(Transactionts=newTransaction(faDoc,"创建族"))

{

ts.Start();

List<XYZ>pointList=newList<XYZ>();

pointList.Add(newXYZ(10/304.8,0,0));

pointList.Add(newXYZ(10/304.8,20/304.8,0));

pointList.Add(newXYZ(20/304.8,20/304.8,0));

pointList.Add(newXYZ(30/304.8,10/304.8,0));

pointList.Add(newXYZ(30/304.8,0,0));

//创建工作平面

Planeplane=Plane.CreateByNormalAndOrigin(XYZ.BasisZ,XYZ.Zero);

SketchPlanesketchPlane=SketchPlane.Create(faDoc,plane);

CurveArrArraycurveArrArray=newCurveArrArray();

CurveArraycurveArray=newCurveArray();

curveArray.Append(Line.CreateBound(pointList[0],pointList[1]));

curveArray.Append(Line.CreateBound(pointList[1],pointList[2]));

curveArray.Append(Line.CreateBound(pointList[2],pointList[3]));

curveArray.Append(Line.CreateBound(pointList[3],pointList[4]));

curveArray.Append(Line.CreateBound(pointList[4],pointList[0]));

curveArrArray.Append(curveArray);

Extrusionextrusion=faDoc.FamilyCreate.NewExtrusion(true,curveArrArray,sketchPlane,1000);

faDoc.FamilyManager.NewType("异形柱");

Elementele=extrusionasElement;

ColumnLocationPointlocationPoint=newColumnLocationPoint();

XYZcenterpoint=null;

locationPoint.GravityCenter(pointList,outcenterpoint);

TaskDialog.Show("输出位置坐标",(centerpoint.X*304.8).ToString()+"\n"+(centerpoint.Y*304.8).ToString()

+"\n"+(centerpoint.Z*304.8).ToString());

XYZpointmove=newXYZ(-centerpoint.X,-centerpoint.Y,-centerpoint.Z);

ElementTransformUtils.MoveElement(faDoc,ele.Id,pointmove);

ts.Commit();

faDoc.SaveAs(@"G\SpecialShapedColumn\mam63.rfa");

faDoc.Close();

}

文章来源:BIM探知先生

仅作分享交流,文章著作权归原作者所有。

转载请注明来源本文地址:https://www.tuituisoft/bim/14944.html

未标题-1.jpg

上一篇:没有了

下一篇:没有了