<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Samples codes for Beams creation in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11122851#M2524</link>
    <description>I assume you mean a wide flange or similar beam? If you install the Plant 3D solution, I believe it comes with it. You didn't say if you wanted that 3D or not.</description>
    <pubDate>Fri, 22 Apr 2022 17:34:58 GMT</pubDate>
    <dc:creator>Ed__Jobe</dc:creator>
    <dc:date>2022-04-22T17:34:58Z</dc:date>
    <item>
      <title>Samples codes for Beams creation</title>
      <link>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11122840#M2523</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does everyone has an example code in VBA that builds a beam?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 17:28:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11122840#M2523</guid>
      <dc:creator>tiago.pereiraGB2J9</dc:creator>
      <dc:date>2022-04-22T17:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Samples codes for Beams creation</title>
      <link>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11122851#M2524</link>
      <description>I assume you mean a wide flange or similar beam? If you install the Plant 3D solution, I believe it comes with it. You didn't say if you wanted that 3D or not.</description>
      <pubDate>Fri, 22 Apr 2022 17:34:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11122851#M2524</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-04-22T17:34:58Z</dc:date>
    </item>
    <item>
      <title>Re: Samples codes for Beams creation</title>
      <link>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11123054#M2525</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14801"&gt;@Ed__Jobe&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to automate the creation of 3D beams, with VBA code. I saw that´s possible with Visual Studio, using C++, but i want to know if there´s any repository of VBA codes that do the same.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I´m attaching an example of C++ code, that´s modeling a beam. Do you know if it´s possible to have the same code in VBA, like a translation only?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks so much!&lt;/P&gt;&lt;LI-CODE lang="cpp"&gt;private void CreateStraightBeam(ref AstObjectsArr createdObjectsArr)
{
//get default profile
string angleSection, angleSize;
getDefaultProfile(0, "HyperSectionW", out angleSection, out angleSize);
//create role object
IRole beamRole = m_Joint.CreateRole("Beam");
//create joint transfer
IJointTransfer jointTransfer = m_Joint.CreateJointTransfer("Beam");
//set some attributes
setJointTransferForBeam(ref jointTransfer, eClassType.kBeamStraightClass);
IPoint3d startPoint = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
IPoint3d endPoint = (IPoint3d)(new DSCGEOMCOMLib.Point3d());
startPoint.Create(0, 0, 0);
endPoint.Create(0, 0, 500);
IVector3d zAxis = (IVector3d)(new DSCGEOMCOMLib.Vector3d());
zAxis.Create(0, 1, 0);
ICS3d inputCS = (ICS3d)(new DSCGEOMCOMLib.CS3d());
inputCS.XAxis = startPoint.Subtract(endPoint);
inputCS.ZAxis = zAxis;
//create a straight beam
//Function will use z axis from input CS and input points to create beam CS
//xAxis = vector from input points (startPoint.Subtract(endPoint))
//yAxis = zAxis.CrossProduct(xAxis) (zAxis from CS)
//zAxis = xAxis.CrossProduct(yAxis)
IStraightBeam straightBeam = m_Joint.CreateStraightBeam(angleSection, angleSize, 
(AstSTEELAUTOMATIONLib.Role)beamRole, startPoint, endPoint, inputCS);
//Add beam to created object array
if(straightBeam != null)
{
 straightBeam.JointTransfer = (AstSTEELAUTOMATIONLib.JointTransfer)jointTransfer;
 createdObjectsArr.Add(straightBeam);
}
}
//Get the default profile from the database (default profiles are set in the GAM)
private void getDefaultProfile(int defaultClass, string className, out string sectionClass, out string
sectionSize)
{
sectionClass = "";
sectionSize = "";
IOdbcUtils tableUtils = (IOdbcUtils)(new DSCODBCCOMLib.OdbcUtils());
string sSectionProf = tableUtils.GetDefaultString(defaultClass, className);
string separator = "#@" + '§' + "@#";
string[] section = sSectionProf.Split(new string[] { separator }, StringSplitOptions.None);
if (section.Length == 2)
{
 sectionClass = section[0];
 sectionSize = section[1];
}
}
//Create the JointTransfer for a beam
private void setJointTransferForBeam(ref IJointTransfer jointTrans, eClassType classType)
{
jointTrans.ClassType = classType;
/set here all the properties which can be modified outside the joint
jointTrans.set_Attribute(eAttributeCodes.kBeamDenotation, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMaterial, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamCoating, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSinglePartNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMainPartNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSinglePartPrefix, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMainPartPrefix, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamAssembly, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamItemNumber, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSinglePartDetailStyle, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMainPartDetailStyle, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamNote, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPUsedForCollisionCheck, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPUsedForNumbering, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPDisplayRestriction, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamSPExplicitQuantity, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMPUsedForCollisionCheck, 1);
jointTrans.set_Attribute(eAttributeCodes.kBeamMPUsedForNumbering, 1);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 19:13:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11123054#M2525</guid>
      <dc:creator>tiago.pereiraGB2J9</dc:creator>
      <dc:date>2022-04-22T19:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Samples codes for Beams creation</title>
      <link>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11123069#M2526</link>
      <description>&lt;P&gt;That code is C# and relies on having Advance Steel installed. The manual says it's a COM api. Perhaps you could reference that api type library in VBA. I don't know if it would work though, since I don't have it. I use Inventor for steel. Plain VBA doesn't have anything like that though. I still recommend using Plant 3D for stock parts usable in AutoCAD. You don't need to program anything. Just use it.&lt;/P&gt;</description>
      <pubDate>Fri, 22 Apr 2022 19:21:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/samples-codes-for-beams-creation/m-p/11123069#M2526</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2022-04-22T19:21:58Z</dc:date>
    </item>
  </channel>
</rss>

