two parallel StructuralMember. However, the result is not what I want.

I want to add two parallel StructuralMember.
However, the result is not what I want.

What's wrong with the code。Thanks。

transaction 1 stateChange 'Add CS01, point1, point2'
{
gcModel
{
node User.Objects.CS01 Bentley.GC.NodeTypes.CoordinateSystem
{
Technique = 'AtDGNModelOrigin';
DGNModelName = 'Design Model';
GraphLocation = {-107.8, -369.4, 0.0, 122.26};
}
node User.Objects.point1 Bentley.GC.NodeTypes.Point
{
Technique = 'ByCartesianCoordinates';
CoordinateSystem = CS01;
XTranslation = <free> 100.0;
YTranslation = <free> 200.0;
ZTranslation = <free> -500.0;
GraphLocation = {-113.0, -217.0};
}
node User.Objects.point2 Bentley.GC.NodeTypes.Point
{
Technique = 'ByCartesianCoordinates';
CoordinateSystem = CS01;
XTranslation = <free> 6000.0;
YTranslation = <free> 200.0;
ZTranslation = <free> 6600.0;
GraphLocation = <auto> {-113.0, -10.79};
}
}
}

transaction 2 stateChange 'Add CenterLine'
{
gcModel
{
node User.Objects.CenterLine Bentley.GC.NodeTypes.Line
{
Technique = 'ByPoints';
StartPoint = point1;
EndPoint = point2;
GraphLocation = <auto> {161.0, -369.4};
}
}
}

transaction 3 stateChange 'Add GroupLines'
{
gcModel
{
node User.Objects.GroupLines Bentley.GC.NodeTypes.Line
{
Technique = 'ByFunction';
Function = function()
{
Point tmpPt=new Point();
tmpPt .ByCartesianCoordinates (CS01 ,0,1000,0,point1 );
Line tmpL01=new Line (this);
tmpL01.ParallelToLineFromStartPoint ( tmpPt ,CenterLine);

Line tmpL02=new Line (this);
tmpPt .ByCartesianCoordinates (CS01 ,0,-1000,0,point1 );
tmpL02.ParallelToLineFromStartPoint ( tmpPt ,CenterLine );
};
FunctionArguments = {};
GraphLocation = <auto> {161.0, -192.49, 0.0, 136.91};
}
}
}

transaction 4 stateChange 'Add structuralMember1'
{
gcModel
{
node User.Objects.structuralMember1 Bentley.GC.NodeTypes.StructuralMember
{
Technique = 'FromLine';
CatalogItem = {'Steel Column','Rs_下柱'};
line = GroupLines;
CrossSection = '1\CN_CAO\CAO14A';
Part = {'Rs_SteelWorkShop', 'Rs_Columns_Bottom'};
GraphLocation = {155.4, 2.6, 0.0, 166.21};
}
}
}

  • Hello Ren,

    The GroupLines that you have created has only point, so that is why it is showing like that. You need to create 2 separate points to make the lines. the function would look something like this. 

    function()
    {

    Point tmpPt1=new Point();
    tmpPt1 .ByCartesianCoordinates (CS01 ,0,1000,0,point1 );
    Line tmpL01=new Line (this);
    tmpL01.ParallelToLineFromStartPoint ( tmpPt1 ,CenterLine);

    Point tmpPt2=new Point();
    Line tmpL02=new Line (this);
    tmpPt2 .ByCartesianCoordinates (CS01 ,0,-1000,0,point1 );
    tmpL02.ParallelToLineFromStartPoint ( tmpPt2 ,CenterLine );
    }

    Hope this helps you.

    Regards,
    Alifur

    Structural member.txt
    transaction 1 stateChange 'Add CS01'
    {
        gcModel
        {
            node User.Objects.CS01 Bentley.GC.NodeTypes.CoordinateSystem
            {
                Technique                 = 'AtDGNModelOrigin';
                DGNModelName              = 'Design Model';
                SymbolSize                = 1.0;
                GraphLocation             = {-107.8, -369.4, 0.0, 122.26};
            }
        }
    }
    
    transaction 2 stateChange 'Add point1, point2'
    {
        gcModel
        {
            node User.Objects.point1 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ByCartesianCoordinates';
                CoordinateSystem          = CS01;
                XTranslation              = <free> 100.0;
                YTranslation              = <free> 200.0;
                ZTranslation              = <free> -500.0;
                GraphLocation             = {-113.0, -217.0};
            }
            node User.Objects.point2 Bentley.GC.NodeTypes.Point
            {
                Technique                 = 'ByCartesianCoordinates';
                CoordinateSystem          = CS01;
                XTranslation              = <free> 6000.0;
                YTranslation              = <free> 200.0;
                ZTranslation              = <free> 6600.0;
                GraphLocation             = <auto> {-113.0, -10.79};
            }
        }
    }
    
    transaction 3 stateChange 'Add CenterLine, GroupLines'
    {
        gcModel
        {
            node User.Objects.CenterLine Bentley.GC.NodeTypes.Line
            {
                Technique                 = 'ByPoints';
                StartPoint                = point1;
                EndPoint                  = point2;
                GraphLocation             = <auto> {161.0, -369.4};
            }
            node User.Objects.GroupLines Bentley.GC.NodeTypes.Line
            {
                Technique                 = 'ByFunction';
                Function                  = function()
                                            {
                                            
                                            Point tmpPt1=new Point();
                                            tmpPt1 .ByCartesianCoordinates (CS01 ,0,1000,0,point1 );
                                            Line tmpL01=new Line (this);
                                            tmpL01.ParallelToLineFromStartPoint ( tmpPt1 ,CenterLine);
                                            
                                            Point tmpPt2=new Point();
                                            Line tmpL02=new Line (this);
                                            tmpPt2 .ByCartesianCoordinates (CS01 ,0,-1000,0,point1 );
                                            tmpL02.ParallelToLineFromStartPoint ( tmpPt2 ,CenterLine );
                                            };
                FunctionArguments         = {};
                DebuggerTrigger           = DebuggerTriggerLevel.Breakpoints;
                GraphLocation             = <auto> {161.0, -192.49, 0.0, 136.91};
            }
        }
    }
    
    transaction 4 stateChange 'Add structuralMember1'
    {
        gcModel
        {
            node User.Objects.structuralMember1 Bentley.GC.NodeTypes.StructuralMember
            {
                Technique                 = 'FromLine';
                CatalogItem               = {'Steel Beam','Beam'};
                line                      = GroupLines;
                placementPoint            = PlacementPoint.CenterCenter;
                CrossSection              = '1\AS_UB\200UB18';
                Part                      = {'Steel', 'Beams'};
                Rotation                  = 0.0;
                StructuralFramingCommon_sectionname = '200UB18.2';
                StructuralFramingCommon_structuralfinish = '';
                ObjectStructuralUsage_StructuralFunction = 'Structural';
                SteelBeamResults_studcount = '';
                SteelBeamResults_camber   = length(0);
                Shear_end1shear           = 0.0;
                Shear_end2shear           = 0.0;
                ObjectIdentity_Mark       = '';
                ObjectIdentity_InstanceMark = '';
                ObjectIdentity_NameAlt    = '';
                ObjectIdentity_Description = '';
                ObjectIdentity_Keynote    = '';
                ObjectIdentity_Tag        = '';
                ObjectIdentity_Notes      = '';
                ObjectFireproofing_HasFireproofing = false;
                ObjectFireproofing_FireproofingType = '';
                ObjectFireproofing_FireproofingMaterial = '';
                ObjectFireproofing_FireproofingThickness = length(0);
                ObjectFireResistance_Rating = '';
                ObjectFireResistance_ReferenceID = '';
                ObjectFireResistance_ReferenceURL = '';
                ObjectFireResistance_IsCombustible = false;
                ObjectFireResistance_Compartmentation = false;
                ObjectFireResistance_SurfaceSpreadofFlame = '';
                ObjectThermalTransmittance_IsExternal = false;
                ObjectThermalTransmittance_IsBelowGrade = false;
                ObjectPhasing_Phasing     = 'New Construction';
                IFC_Override_IfcOverride  = '';
                IFC_Override_Ifc4Override = '';
                IFC_Override_ObjectType   = '';
                ObjectClassification_CBI2011 = '3411';
                ObjectClassification_MasterFormat = '05 12 23';
                ObjectClassification_NATSPEC = '03 410';
                ObjectClassification_NTE  = ' EEA-';
                ObjectClassification_OmniClass = '22-05 12 23';
                ObjectClassification_Uniclass = 'G261';
                ObjectClassification_Uniclass2015 = '';
                ObjectClassification_UniFormat = 'B1010 ';
                ObjectDiscipline_Discipline = '';
                ObjectLEED_PercentRecycled = 25;
                ObjectLEED_IsRegionalMaterial = false;
                ObjectLEED_PercentPostConsumer = 0;
                Pset_BeamCommon_Reference = '';
                Pset_BeamCommon_Span      = length(0);
                Pset_BeamCommon_Slope     = 0.0;
                Pset_BeamCommon_Status    = '';
                Pset_BeamCommon_Roll      = 0.0;
                Pset_BeamCommon_ThermalTransmittance = 0.0;
                Pset_ManufacturerOccurrence_BarCode = '';
                Pset_ManufacturerOccurrence_SerialNumber = '';
                Pset_ManufacturerOccurrence_BatchReference = '';
                Pset_ManufacturerTypeInformation_GlobalTradeItemNumber = '';
                Pset_ManufacturerTypeInformation_ArticleNumber = '';
                Pset_ManufacturerTypeInformation_ModelReference = '';
                Pset_ManufacturerTypeInformation_ModelLabel = '';
                Pset_ManufacturerTypeInformation_Manufacturer = '';
                Pset_ManufacturerTypeInformation_ProductionYear = '';
                Pset_ManufacturerTypeInformation_AssemblyPlace = '';
                StructuralData_Mark       = '';
                StructuralData_Type       = '';
                StructuralData_Material   = '';
                StructuralData_Grade      = '';
                StructuralData_Status     = '';
                StructuralData_Class      = '';
                StructuralData_User1      = '';
                StructuralData_User2      = '';
                StructuralData_User3      = '';
                StructuralData_User4      = '';
                StructuralData_Detail1    = '';
                StructuralData_Detail2    = '';
                GraphLocation             = {445.0, -239.8, 174.0, 166.21};
            }
        }
    }

    Answer Verified By: Anik Mal