Пример #1
0
        private StringBuilder CreateLuxObjectInstanceFromFamily(LuxExporter.Revit_Instance objInstance, LuxExporter.Revit_Linked_Files RevitLink)
        {
            StringBuilder dummy = new StringBuilder();
            if (RevitLink==null)
            {
                dummy.AppendLine("AttributeBegin");
                dummy.AppendLine("TransformBegin");
                //calculate Transformation matrix
                LuxExporter.Revit_Transform TransFormMatrix = new Revit_Transform();
                String sTransFormMatrix = TransFormMatrix.TransformationInHost(objInstance.FamilyTransform);
                //finalise output string
                dummy.AppendLine("#Revit T CreateLuxObjectInstanceFromFamily");
                dummy.AppendLine("Transform [" + sTransFormMatrix + "]");
                dummy.AppendLine("ObjectInstance \"" + objInstance.GetUniqueFamilyInstanceName.ToString() + "\"");
                dummy.AppendLine("TransformEnd");
                dummy.AppendLine("AttributeEnd");
            }

            else
            {
                foreach (Transform item in RevitLink.Transformations)
                {
                    dummy.AppendLine("AttributeBegin");
                    dummy.AppendLine("TransformBegin");
                    //calculate Transformation matrix
                    LuxExporter.Revit_Transform TransFormMatrix = new Revit_Transform();
                    String sTransFormMatrix = TransFormMatrix.TransformationInLink(objInstance, item);
                    //finalise output string
                    dummy.AppendLine("#Revit T ...");
                    dummy.AppendLine("Transform [" + sTransFormMatrix + "]");
                    dummy.AppendLine("ObjectInstance \"" + objInstance.HostName+"_"+ objInstance.GetUniqueFamilyInstanceName.ToString() + "\"");
                    dummy.AppendLine("TransformEnd");
                    dummy.AppendLine("AttributeEnd");
                    dummy.AppendLine("");
                }
            }
                        return dummy;
        }
Пример #2
0
        private StringBuilder CreateLuxInstanceFromSystemFamily(LuxExporter.Revit_Linked_Files RevitLink, String ObjectName)
        {
            StringBuilder dummy = new StringBuilder("");

            foreach (Transform item in RevitLink.Transformations)
            {
                dummy.AppendLine("AttributeBegin");
                dummy.AppendLine("TransformBegin");
                //calculate Transformation matrix
                LuxExporter.Revit_Transform TransFormMatrix = new Revit_Transform();
                String sTransFormMatrix = TransFormMatrix.TransformationInHost(item);
                //finalise output string
                dummy.AppendLine("#Revit T CreateLuxInstanceFromNonFamily");
                dummy.AppendLine("Transform [" + sTransFormMatrix + "]");
                dummy.AppendLine("ObjectInstance \"" + RevitLink.LinkShortName + "_" + ObjectName + "\"");
                dummy.AppendLine("TransformEnd");
                dummy.AppendLine("AttributeEnd");
                dummy.AppendLine("");
            }

            return dummy;
        }