Sie sind auf Seite 1von 5

Creating .

NET Joints
Conceptually, the process of developing a joint using the .NET API is not different from the one based on
the COM API. However there are a few differences here and there. Please find below the steps involved in the
creation of a new .NET joint:

1. Build a new .NET dll.


2. Reference the following AS SDK libraries (those are the most important libraries, but you may or may
not need them all or you may need others as well):
a. ASObjectsMgd (to get access to Joints specific classes and interfaces and most Advance Steel
objects )
b. ASGeometryMgd (to get access to 2d, 3d geometry libraries, points, vectors, matrices, curves,
etc)
c. ASCadLinkMgd (to get access to ObjectId and a few other CAD related classes and utilities)
d. DotNetRoots (to get access to units, databases, …)
3. Create a new class that will represent your new joint
a. Make it implement the Autodesk.AdvanceSteel.ConstructionTypes.IRule interface (found in
ASObjectsMgd.dll library)
4. Make sure you implement all the IRule methods (they are all called during the lifecycle of a joint in an
Advance Steel model)
a. JointId is just something you may need later – you can provide a simple auto-implementation
like:
public ObjectId JointId { get; set; }
b. Query
i. this is where your joint has the chance to select / define it’s input
elements (which at this time can be any
Autodesk.AdvanceSteel.CADAccess.FilerObject, usually beams, plates,
“UserDefinedPoint”
ii. after selecting the input elements, the query method should end with
something like this:
IJoint jnt = DatabaseManager.Open(JointId) as IJoint;
if (null != jnt)
{
jnt.setInputObjects(new FilerObject[] { udpStart, udpEnd }, new int[] { 1, 1 });
}
The joint needs to be told which are the input objects that it will later depend on
c. GetTableName is an optional method. It is useful if a table is defined inside the
AstorRules database that will store predefined values for your joint. At this
time we are still looking into improving the behavior related to this method /
table.
d. GetRulePages
i. is the place where the .NET joints can describe the parameters that the
user can modify to control the joint behavior.
ii. This is an important difference from the COM API based joints: the .NET
API joint are no longer free to define whatever UI they want – the UI will
be built in a descriptive manner which has 3 important effects:
1. Simplifies the process for the joint developer (no need to worry
about UI, controls interaction, page size, updating joint when user
changes something, etc)
2. Ensures UI consistency – all joints will have a similar look and
feel
3. Restricts somewhat the possibilities related to UI (we plan to
enhance this in the future according to users feedback, but for the
first version it will provide a quite simple but functional UI)
e. Save / Load
i. are designed to define the parameters that the joints needs to consider as input for it’s
calculations
ii. the best practice is that the parameters saved here, reflect in the UI, the user can
directly change them in the joint UI (the descriptions of the UI used in the
“GetRulePages” method will refer to the parameters saved / loaded on those methods)
f. GetRulePages is the method where the joint is supposed to do all the
calculations, objects creation, modification, etc. having access to the input
elements defined in the Query method and the user controllable parameters that
are serialized on the Save / Load methods
5. Register the joint in AS to make it available for users
a. This process is almost identical to the one from the COM API joints
b. Open the AstorRules database (typically: c:\ProgramData\Autodesk\Advance Steel
2018\USA\Steel\Data\ or in the currently installed country folder)
c. Open RulesDllSigned table
d. Add a new record:
i. Key – something away from the standard Advance Steel range, ex: 150000
ii. FileName – the name of the dll (library) you implemented your joint into (the one from
step 1)
iii. Tech: this is:
1. “0” for joints based on COM API, implemented in c++
2. “1” for joints based on COM API, implemented in .NET
3. “2” for .NET API joints
4. If you follow this tutorial you should use 2 here
iv. Signature: unused at the moment
e. Open HLRDefinition table
f. Add a new record here:
i. Key: use something away from the standard Advance Steel ones, ex. 150000
ii. Rule run name: this is what the users will see your joint as
iii. Internal name: use here, a unique simple name with no spaces – it is used to invoke
your joint
iv. Category: used to group joints families
v. Dll: the key you used in the “RulesDllSigned” table (see above)
vi. SubNameInDll: the complete name of the class that implements the IRule interface
including the namespace – your joint (see step 3)
vii. ClassId: just generate a new unique GUID here for your connection – it will only be
useful if you create a joint design module for your joint as well.
6. Test and see that your joint is called by AdvanceSteel:
a. Start Advance Steel
b. Type AstM4CrConByVb <jointName> (the string you filled in HLRDefinition in step 5/f/iii)

Making the joint available in Revit


Currently Advance Steel joints are available in Revit under the Steel Connections addon. Any third party Advance
Steel joints require the installation of the Steel Connections addon in Revit in order to work. Also they have to be
installed in Revit, in Addons\SteelConnections sub folder together with the other Advance Steel components.

After creating a joint and making it available in AdvanceSteel (under AutoCAD), there are some special steps
required in order to make it available in Revit too:

 add info about the new joint in SteelConnectionsData.xml similar to what you have for the other joints
- make sure the typeId field from the xml has the same guid as the classId from
AstorRules.HRLDefinition table.
- fill the Images and PreviewText with the names of your corresponding resources
Example:
<PaletteItem>
<Description>Sample joint</Description>
<Command>samplejoint</Command>
<PreviewText>Preview text for the sample joint</PreviewText>
<Images>
<string>SampleJointImage.png</string>
</Images>
<PreviewImages>
<string>SampleJointPreviewImage.png</string>
</PreviewImages>
<TypeId>DFB7A86F-7E86-40F2-8E58-C16C776F7464</TypeId>
<ShowSectionMaterial>false</ShowSectionMaterial>
<ShowWeldType>false</ShowWeldType>
<ShowWeldThickness>false</ShowWeldThickness>
</PaletteItem>
- add the resource dll name ( the one that contains the image and preview image for the joint)
to the ResourceDll and PreviewResourceDll fields. The resources dll names should be separated with a
comma (“,”) from the existing dll names.
Example:
<ResourceDll>ASConnectionsResources.dll,SampleJointDotNetResources.dll</ResourceDll>

<PreviewResourceDll>ASConnectionsPreviews.dll,SampleJointDotNetResources.dll</PreviewResourceDll>
 update table AstorRules.AutoFilteringConfig with information about the new joint
Example:
Key 999999
Category SampleJoint
RunName ColOrRaf Any to ColOrRaf Any
InputSet Any+Any
InputSetConds No Condition
RuleInternalName SampleJoint
ObjectsOrderForJoints 2 Beams inversed
OwnerText

For more information about configuring the AstorRules.AutoFilteringConfig please check the following
document: "AstorRules set up for SteelConnection Project.docx"
 Installation (joint dll, dot net resources dll and all the AS databases and xml-s updated for all the languages).
Currently the Steel Connections addon is installed in 4 languages; so the databases and
SteelConnectionsData.xml for each country has to be updated accordingly.

The path to the SteelConnections binaries should be composed from the Revit install location read from Registry
Keys (e.g. HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\Revit\2018\REVIT-05:0409\InstallationLocation) and the
relative path to the Revit Addins (AddIns\SteelConnections). The result should be something like this:

“C:\Program Files\Autodesk\Revit 2018\” + “AddIns\SteelConnections”.

Joint input objects

The Advance Steel joints currently work on the Revit structural beams and structural columns families; these
families have already been preconfigured starting with Revit 2016.

In order for the Revit families to be compatible with AS, their family symbol has to have the
Structural_Section_Name_Key parameter and the StructuralFamilyNameKey property set in accordance with the
table RevitASProfileConversion table from AstorProfiles.mdf. These two (the parameter and the property) cannot
be set from the user interface.

Joint parameters in Revit

The joint parameters are saved in Revit’s external storage. The external storage can be accessed with the already
existing Revit API functionality (like Schema and Entity).

Special steps required to add a joint design module in Revit

- there are no special requirement for adding am Advance Steel joint design module to Revit; the dll has to be
installed in the Steel Connections folder and the Advance Steel databases for Steel Connections have to be updated
accordingly (just like for AS)
Install location

From registry key HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R22.0\ACAD-1026 read the value of


“BinPath”. Navigate to the obtained folder (eg. C:\Program Files\Autodesk\AutoCAD 2018\ADVS\). This is where
the joint dll should be copied.

Das könnte Ihnen auch gefallen