本文整理汇总了C#中XYZ.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# XYZ.ToString方法的具体用法?C# XYZ.ToString怎么用?C# XYZ.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XYZ
的用法示例。
在下文中一共展示了XYZ.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ProcessThing
internal WatchItem ProcessThing(XYZ pt, string tag, bool showRawData = true)
{
var um = dynSettings.Controller.UnitsManager;
if (!showRawData)
{
///xyzs will be in feet, but we need to show them
///in the display units of choice
///
var xyzStr = string.Format("{0:f3}, {1:f3}, {2:f3}",
new Units.Length(pt.X / SIUnit.ToFoot, um),
new Units.Length(pt.Y / SIUnit.ToFoot, um),
new Units.Length(pt.Z / SIUnit.ToFoot, um));
return new WatchItem("{" + xyzStr + "}", tag);
}
return new WatchItem(pt.ToString(), tag);
}
示例2: getFurns
private string getFurns(ElementId spaceID, string RoomRNum)
{
string furnsOutput = String.Empty;
// Go through the room and write out the windows/doors
// DOORS //
// Get all doors that have space where id equals current space.
FilteredElementCollector fecDoors = new FilteredElementCollector(_doc)
.OfCategory(BuiltInCategory.OST_Doors)
.OfClass(typeof(FamilyInstance));
// WINDOWS //
FilteredElementCollector fecWindows = new FilteredElementCollector(_doc)
.OfCategory(BuiltInCategory.OST_Windows)
.OfClass(typeof(FamilyInstance));
List<Element> doorsList = new List<Element>();
List<Element> windowList = new List<Element>();
foreach (Element e in fecDoors)
{
FamilyInstance fi = e as FamilyInstance;
if (fi != null && fi.Space != null && fi.Space.Id == spaceID)
doorsList.Add(fi);
}
foreach (Element e in fecWindows)
{
FamilyInstance fi = e as FamilyInstance;
if (fi != null && fi.Space != null && fi.Space.Id == spaceID)
windowList.Add(fi);
}
//Add Number of Furns to string
furnsOutput += (doorsList.Count + windowList.Count).ToString() + "\n";
// Loop through new list of Doors
int furnNumber = 1;
foreach (Element e in doorsList)
{
FamilyInstance fi = e as FamilyInstance;
// Door Width (in meters)
string doorWidth = (fi.Symbol.get_Parameter(BuiltInParameter.DOOR_WIDTH).AsDouble() * 0.3048).ToDecimalString();
// Door height (in meters)
string doorHeight = (fi.Symbol.get_Parameter(BuiltInParameter.DOOR_HEIGHT).AsDouble() * 0.3048).ToDecimalString();
LocationPoint lp = fi.Location as LocationPoint;
XYZ p = new XYZ(lp.Point.X * 0.30, lp.Point.Y * 0.30, 0);
//XYZ p = new XYZ(lp.Point.X, lp.Point.Y, 0);
string lps = p.ToString().Substring(1, p.ToString().Length - 2);
//string lps = lp.Point.ToDecimalString().Substring(1, lp.Point.ToDecimalString().Length - 2);
string sfurnNumber = "Furn" + furnNumber.ToString();
//Furn1=door
//Furn1.Ref=ROOM.R1.F1
//Furn1.Rot=90.00 0.00 0.00
//Furn1.Pos=1.151 3.67 0
//Furn1.Size=1.0 2.0 0.0
furnsOutput += sfurnNumber + "=door\n";
furnsOutput += sfurnNumber + ".Ref=" + RoomRNum + ".F" + furnNumber.ToString() + "\n";
// TODO: fix rotation
furnsOutput += sfurnNumber + ".Rot=90.00 0.00 0.00" + "\n"; //rotation???
// TODO: fix positioning...
furnsOutput += sfurnNumber + ".Pos=" + lps + "\n";
furnsOutput += sfurnNumber + ".Size=" + doorWidth + " " + doorHeight + " 0.00\n";
//Inrement furns
furnNumber++;
}
// WINDOWS //
foreach (Element e in fecWindows)
{
FamilyInstance fi = e as FamilyInstance;
// Window Width
string windowWidth = (fi.Symbol.get_Parameter(BuiltInParameter.WINDOW_WIDTH).AsDouble() * 0.3048).ToDecimalString();
// Window Height
string windowHeight = (fi.Symbol.get_Parameter(BuiltInParameter.WINDOW_HEIGHT).AsDouble() * 0.3048).ToDecimalString();
LocationPoint lp = fi.Location as LocationPoint;
//XYZ p = new XYZ(lp.Point.X * 0.30, lp.Point.Y * 0.30, lp.Point.Z * 0.30);
Transform t1 = fi.GetTransform();
XYZ p = new XYZ(t1.BasisX.X * 0.30, t1.BasisX.Y * 0.30, lp.Point.Z * 0.30);
string lps = p.ToString().Substring(1, p.ToString().Length - 2);
string sFurnNumber = "Furn" + furnNumber.ToString();
furnsOutput += sFurnNumber + "=win\n";
furnsOutput += sFurnNumber + ".Ref=" + RoomRNum + ".F" + furnNumber.ToString() + "\n";
// TODO: fix rotation
furnsOutput += sFurnNumber + ".Rot=90.00 0.00 0.00" + "\n"; //rotation???
// TODO: fix positioning...
furnsOutput += sFurnNumber + ".Pos=" + lps + "\n";
furnsOutput += sFurnNumber + ".Size=" + windowWidth + " " + windowHeight + " 0.00\n";
//Inrement furns
furnNumber++;
}
return furnsOutput;
}
示例3: SerializeXYZ
public static string SerializeXYZ(XYZ value)
{
//transform to string
return value.ToString();
}
示例4: ProcessThing
private void ProcessThing(WatchNode root, XYZ pt, WatchNode node)
{
var um = dynSettings.Controller.UnitsManager;
if (!root.ShowRawData)
{
///xyzs will be in feet, but we need to show them
///in the display units of choice
var xyzStr = string.Format("{0:f3}, {1:f3}, {2:f3}",
new Units.Length(pt.X/SIUnit.ToFoot, um),
new Units.Length(pt.Y/SIUnit.ToFoot, um),
new Units.Length(pt.Z/SIUnit.ToFoot, um));
node.NodeLabel = "{" + xyzStr + "}";
}
else
{
node.NodeLabel = pt.ToString();
}
}