当前位置: 首页>>代码示例>>C#>>正文


C# XYZ.ToString方法代码示例

本文整理汇总了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);
        }
开发者ID:jimmplan,项目名称:Dynamo,代码行数:20,代码来源:RevitWatchHandler.cs

示例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;
        }
开发者ID:kmorin,项目名称:STF-Exporter,代码行数:100,代码来源:Command.cs

示例3: SerializeXYZ

 public static string SerializeXYZ(XYZ value)
 {
    //transform to string
    return value.ToString();
 }
开发者ID:whztt07,项目名称:RevitCustomIFCexporter,代码行数:5,代码来源:IFCCommandOverrideApplication.cs

示例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();
                }
            }
开发者ID:parchjs,项目名称:Dynamo,代码行数:21,代码来源:DynamoController_Revit.cs


注:本文中的XYZ.ToString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。