Quantcast
Channel: MicroStation Programming Forum - Recent Threads
Viewing all articles
Browse latest Browse all 7260

RE: Need Assistance in VBA Code

$
0
0

Hi Benjamin,

It would be helpful to provide some code for us to look at so we can understand what you are trying to populate the enumerator with, so we can point you to sample code on how to do that properly.

From what I see you appear to be doing AECOsim Building Designer programming (TFPartRefList in screen capt).  I did a quick search of the delivered .mvba files for TFPartRefList and found these mvba projects that may help you further (if not password protected):

  • AECOsimBuildingDesigner\vba\corbels.mvba
  • AECOsimBuildingDesigner\vba\gsaexport.mvba
  • AECOsimBuildingDesigner\vba\standaloneexport.mvba
  • AECOsimBuildingDesigner\vba\support.mvba

Quickly looking into the Support.mvba(DrawMethodsmodule) what it does with a TFPartRefList (below for convenience) it appears to show how to set/load the list and walk the associated part ref node and part family.

Sub ShowAllInsulationParts()
    Dim InsulationPartRefList As TFPartRefList
    Dim InsulationPartRef As TFPartRef
    Dim InsulationPart As TFPart
    Dim InsulationPartlist As TFPartList
    Dim j As Integer
    Dim tempfamilyname As String
    Dim tfAppNode As TFApplicationList
    Dim tfApp As TFApplication

    Set tfAppNode = Application.CreateObjectInMicroStation("TFCOM.TFApplicationList.2")
    Set tfApp = tfAppNode.TFApplication

    tempfamilyname = ""
    tfApp.GetActiveParts InsulationPartRefList
    For j = 0 To InsulationPartRefList.GetCount - 1
        Set InsulationPartRef = InsulationPartRefList.GetNode(j)
        If tempfamilyname <> InsulationPartRef.GetPartFamilyName Then
            tempfamilyname = InsulationPartRef.GetPartFamilyName
            frmInsulationParts.cmbFamily.AddItem InsulationPartRef.GetPartFamilyName
        End If
    Next j
    frmInsulationParts.cmbFamily.ListIndex = 0
End Sub

HTH,
Bob


Viewing all articles
Browse latest Browse all 7260

Trending Articles