大神求助看看这个代码怎么改才能用
using System;using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;
using Autodesk.Revit.DB;
using Autodesk.Revit.UI;
using Autodesk.Revit.ApplicationServices;
using Autodesk.Revit.Attributes;
using Autodesk.Revit.UI.Selection;
public class RevitCommand : IExternalCommand
{
public Result Execute(ExternalCommandData commandData, ref string messages, ElementSet elements)
{
FilteredElementCollector collector = new FilteredElementCollector(document);
ICollection<Element>collection=collector.OfClass(typeof(FamilySymbol)).ToElements();
foreach (Element d in collection)
{
familysymbol = d as FamilySymbol;
if (null != familysymbol.Category)
{
if (familysymbol.Name == "自建族名称")
{
fs = familysymbol as Family Symbol;
break;
}
}
}
a = curve.Length * 304.8;
b = 7200.00;
while (c < 1)
{
XYZ location = new XYZ(curve.Evaluate(c, true).X, curve.Evaluate(c, true).Y , curve.Evaluate(c, true).Z);
Family Instanceinstance=document.Create.New Family Instance(location,fs,
Structural Type.Non Structural);
i += 1;
c = b * i / a;
}
}
}
很好。 来学习一下 来学习 只想充实在知识的海洋 很好的呢
页:
[1]