Default Section Name for Steel Sections Defined from Robot Database

Default Section Name for Steel Sections Defined from Robot Database

AnthonyMcTigue
Advocate Advocate
1,688 Views
8 Replies
Message 1 of 9

Default Section Name for Steel Sections Defined from Robot Database

AnthonyMcTigue
Advocate
Advocate

Good Morning All,

 

I am wondering if anyone here has any knowledge of how Robot decides the default name for steel sections loaded into project from a pro.xml database?   As most will be aware, the default Robot uses is Family followed by a space followed by DIM1xDIM2xDIM3.  So, for example, if I want to define a 25 mm by 3 mm thick equal angle section from the Australian database, Robot assigns the name as EA 25x25x3 which is fine for most common sections however, I frequently encounter situations where I have build-up members which require something far more descriptive than this.

 

After years of experimenting with this, I have foudn the safest and most reliable way to handle built-up members is with used defined databases.  I have gotten to a stage through the development of workflows, spreadsheets, VBA macros and Dynamo scripts where I can generate built up section databases relatively quickly.  However, given the limitations of the DIM1, DIM2 and DIM3 fields of the pro.xml databases which restricts you to numbers only in this field, this makes naming built up sections very problematic and the defaulty names Robot assigns while they make sense to me are at very best cumbersome and will make absolutely no sense to anyone else. 

 

For example, I have a custom database which contains a section which is a 12'' x 5'' x 32# I section with three cover plates which is called 12'' x 5'' x 32# I + 3 No. 9'' WIDE x 1/2'' THICK PLATES E/F (BSB 121 - BS 4 (1932)) in the REVIT_NAME field.  For the purposes of working within the limitations of the pro.xml database, the SECTION NAME field is 6P1I (i.e. 6 x plates + 1 x 'I'-section), DIM_1 is 112532 (i.e. the basic 'I'-section size with all non numeric characters removed preceeded by the number 1), DIM_2 is 290529052905 (i.e. the plate buildup consiting of the plate width and height preceeded by the number 2 which reads as three groups of 2 x 9'' Wide by 1/2'' Thick plates) and DIM_3 is the unit weight of the compound plate as per normal.  The default name that Robot therefore assigns to this section is 6P1I 112532x290529052905x123 which is not very useful.  The name I would like Robot to assign to this section and others like it would match the format from the NAME_REVIT field which is 12'' x 5'' x 32# I + 3 No. 9'' WIDE x 1/2'' THICK PLATES E/F (BSB 121 - BS 4 (1932)).  Is this something that could be done?

 

Anthony

0 Likes
Accepted solutions (1)
1,689 Views
8 Replies
Replies (8)
Message 2 of 9

Stephane.kapetanovic
Mentor
Mentor

hi @AnthonyMcTigue 

Label names can support longer strings than those that are interpreted when loading the databases.

Stephanekapetanovic_1-1704954797491.png

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 3 of 9

AnthonyMcTigue
Advocate
Advocate

@Stephane.kapetanovic,

 

Thanks for your reply but this is not the question I asked.  I know you can manually type in longer names than those that Robot assigns by default using the SECTION NAME followed by DIM1xDIM2xDIM3 naming convention.  The question I asked was if it was possible to force Robot by default to read the information from the NAME_REVIT field and assign that as the section name.

 

Anthony

Message 4 of 9

Stephane.kapetanovic
Mentor
Mentor

Your questions are well structured and direct. I have tried to be practical about the current situation and to propose a compromise in two steps that is both acceptable and quick.

Your question concerns the selection of an explicit section name containing its definition and consequences, as well as the mapping of section names when transferring between Revit and Robot.
I might add that I would like to see the XML structure of the data and the capacity of the editor reviewed.

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 5 of 9

AnthonyMcTigue
Advocate
Advocate

@Stephane.kapetanovic,

 

Thank you for your continued interest in this.  I have basically being doing what you suggested but as you can understand, it's far from ideal and feeds into my general frustration with the software which is that despite being highly capable, it is hamstrung buy stupid s**t like this which makes it much harder to do simple things like this than really is ought to be necessary.  The pro.xml format files that contain so much of the information that the program relies on to work are appalingly untransparent and incredibly difficult to work with and manilupate as a non programmer.  Problems such the this I find particularly annoying because Robot already has all the information it needs to assign a comprehensible name to sections of this type.  I spent a long time working out how to automate this and keep it constent in both my Revit families and Robot databases, to get it all to work within the limitations of the pro.xml database format and yet still be adaptable enough to accommodate the vasy array of built up section types and shapes that I encounter on real world structures. 

 

Robot already has all that information yet somewhere, somehow, some programmer decided that there is not, never has been and never will be a steel section used anywhere in the world that can't be defined by what is it, something like 6 alphamnumeric characters in the SECTION NAME field followed by up to three numbers????  I firmly believe that software developers who work on engineering and construction software in particular ought to be made work in real design offices solving real world design problems using the very same software that they program and see for themselves just how utterly infuriating and limiting some of their programming decisions are on the practical implementation of the software they program. 

 

Anthony

0 Likes
Message 6 of 9

Stephane.kapetanovic
Mentor
Mentor

hi @AnthonyMcTigue

I fully understand your concerns regarding the way section names are currently managed, as well as the difficulties non-developers face when working with catalog files.

Below is a code snippet you can use as a starting point to rename sections sourced from a custom catalog within your projects.

Sub RenameAllSectionsFromCustomDB()
  Dim RobApp As RobotApplication
  Set RobApp = New RobotApplication
  If Not (RobApp.Visible = -1 And RobApp.Project.IsActive = -1) Then
    Set RobApp = Nothing: Exit Sub
  End If
  
  Dim Bars As RobotBarServer, Labels As RobotLabelServer
  Dim Label As RobotLabel, LabelData As IRobotBarSectionData
  Dim NewLabel As RobotLabel, NewLabelData As IRobotBarSectionData
  Dim LabelSectionsCollection As RobotLabelCollection
  Dim Selections As RobotSelectionFactory, BarSel As RobotSelection
  
  Dim Preferences As RobotProjectPreferences
  Dim Materials As RobotMaterialDatabase, SectionsActive As RobotSectionDatabaseList
  With RobApp.Project
    Set Preferences = .Preferences
    With Preferences
      Set Materials = .Materials
      Set SectionsActive = .SectionsActive
    End With
    With .Structure
      Set Bars = .Bars
      Set Labels = .Labels
      Set Selections = .Selections
    End With
  End With
  Set LabelSectionsCollection = Labels.GetMany(I_LT_BAR_SECTION)
  
  Dim SectionDBName As String, MaterialDBName As String:
  SectionDBName = "CustomDBName"
  MaterialDBName = "MaterialDBName"
  
  If Not IsAvailableDB(SectionsActive, SectionDBName) Then
    MsgTxt = "The sections database " & SectionDBName & " has not been loaded" & vbCrLf & _
             "Do you want to add the database to the project preferences?"
    If MsgBox(MsgTxt, vbYesNo + vbQuestion, "Database Loading") = vbYes Then
      Preferences.SetCurrentDatabase I_DT_SECTIONS, SectionDBName
      If Not IsAvailableDB(SectionsActive, SectionDBName) Then
        Set RobApp = Nothing: Exit Sub
      End If
    Else
      Set RobApp = Nothing: Exit Sub
    End If
  End If
      
  Dim SectionDB As RobotSectionDatabase
  Dim AvailableMaterials As RobotNamesArray, Sections As RobotNamesArray, AvailableSections As RobotNamesArray
  
  Set Sections = RobApp.CmpntFactory.Create(I_CT_NAMES_ARRAY)
  For idx = 1 To SectionsActive.Count
    Set SectionDB = SectionsActive.GetDatabase(idx)
    If SectionDB.Name = SectionDBName Then Set Sections = SectionDB.GetAll
  Next idx
  Set AvailableSections = Labels.GetAvailableNames(I_LT_BAR_SECTION)
   
  If Materials.Load(MaterialDBName) = 0 Then ' DB Material Not Found
    MsgBox "The material database " & MaterialDBName & " has not been loaded", vbOKOnly & vbCritical, "Error"
    Set RobApp = Nothing: Exit Sub
  End If
  Set AvailableMaterials = Materials.GetAll
  
  Dim SectionName As String, MaterialName As String, RevitName As String
  Dim HasMaterial As Boolean, IsFromDB As Boolean
  Dim ExistRevitName As Boolean, HasRevitName As Boolean, IsUsed As Boolean
  For i = 1 To LabelSectionsCollection.Count
    Set Label = LabelSectionsCollection.Get(i)
    Set LabelData = Label.Data
    With LabelData
         SectionName = .Name
        MaterialName = .MaterialName
           RevitName = ""
      ExistRevitName = .FindAlias("NAME_REVIT", RevitName)
    End With
    
    HasRevitName = ExistRevitName And Not (RevitName = "" Or RevitName = "0")
    HasMaterial = AvailableMaterials.Find(MaterialName, 1) > 0
    IsFromDB = Sections.Find(SectionName, 1) > 0
    IsUsed = AvailableSections.Find(SectionName, 1) > 0
    
    ReadyForConversion = HasRevitName And HasMaterial And IsFromDB And IsUsed
        
    If ReadyForConversion Then
      NewName = RevitName
      If Labels.IsAvailable(I_LT_BAR_SECTION, NewName) Then
        MsgBox "The section name " & NewName & " already exists and cannot be created", vbExclamation, "Error"
      Else
        Set NewLabel = Labels.Create(I_LT_BAR_SECTION, NewName)
        Set NewLabelData = NewLabel.Data
            NewLabelData.MaterialName = MaterialName
            NewLabelData.LoadFromDBase2 SectionName, SectionDBName
        Labels.Store NewLabel
        Set BarSel = Selections.CreateByLabel(I_OT_BAR, I_LT_BAR_SECTION, SectionName)
        Bars.SetLabel BarSel, I_LT_BAR_SECTION, NewName
          
        Labels.Delete I_LT_BAR_SECTION, SectionName
      End If
    End If
  Next i
  Set RobApp = Nothing
End Sub

Function IsAvailableDB(SectionsActive As RobotSectionDatabaseList, SectionDBName As String) As Boolean
  Dim SectionDB As RobotSectionDatabase, Sections As RobotNamesArray
  For i = 1 To SectionsActive.Count
    Set SectionDB = SectionsActive.GetDatabase(i)
    If SectionDB.Name = SectionDBName Then
       Set Sections = SectionDB.GetAll
       If Sections Is Nothing Then ' DB Section Not Found
         MsgBox "The sections database " & SectionDBName & " does not exist", vbOKOnly + vbCritical, "Error"
         IsAvailableDB = False: Exit Function
       End If
       If Sections.Count = 0 Then  ' DB Section Empty
         MsgBox "The sections database " & SectionDBName & " is empty", vbOKOnly + vbCritical, "Error"
         IsAvailableDB = False: Exit Function
       End If
       IsAvailableDB = True: Exit Function
    End If
  Next i
  IsAvailableDB = False
End Function

Should you have any other points to discuss or additional questions, please do not hesitate to inform me.

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
Message 7 of 9

AnthonyMcTigue
Advocate
Advocate

@Stephane.kapetanovic,

 

Thanks for much for the code.  I will have a play with it and post any updated versions.

 

Anthony

Message 8 of 9

Stephane.kapetanovic
Mentor
Mentor
Accepted solution

hi @AnthonyMcTigue 

As discussed in the PM, I updated the code from my previous message to make it more general for the renaming of sections based on their Revit name.

Note that for the insertion of a few special sections and file exchange limited to drawing and calculation analysis interaction, programming is probably not necessary in all cases. The Revit section name is already accessible from the drop-down list labeled 'label' in the section edit dialog

Stephanekapetanovic_1-1706527881817.png

Best Regards

Stéphane Kapetanovic

Did you find this post helpful? If it gave you one or more solutions,
don't forget to accept the solution and leave a < like !
EESignature
0 Likes
Message 9 of 9

AnthonyMcTigue
Advocate
Advocate

@Stephane.kapetanovic,

 

Thanks for your assistance.  I will be honest when I say I never actually looked at tha dropdown menu or even knew it was a dropdown menu until now as when building models with Robot supplied database, the default name here works perfectly fine.

 

Anthony