2020 VBA can't find Property Set Definitions

2020 VBA can't find Property Set Definitions

FrankMayfield
Enthusiast Enthusiast
854 Views
3 Replies
Message 1 of 4

2020 VBA can't find Property Set Definitions

FrankMayfield
Enthusiast
Enthusiast

I'm porting a client from 2017 to 2020 ACA. There is some VBA code that reads the Property Set Definitions to continue filling out a schedule when a block is inserted. Anyway, the exact same code/drawing works in 2017 but not in 2020.

 

My question for the group is why, and how can I make this work? It is critical to the upgrade.

 

Here is the relavant pieces of code:

 

Dim objSchApp As New AecScheduleApplication
Dim objPSDs As AecSchedulePropertySetDefs
Dim objPSD As AecSchedulePropertySetDef

Set objPSDs = objSchApp.PropertySetDefs(ThisDrawing.Database)

 

A few lines later ...

 

If Not objPSDs Is Nothing Then  (this proves to be false, bypassing all the real work had it been true)

 

I'm an autolisper, and know not much about VBA. Any help getting this fixed is appreciated.

 

Frank


Frank Mayfield


EESignature

0 Likes
855 Views
3 Replies
Replies (3)
Message 2 of 4

pendean
Community Legend
Community Legend
0 Likes
Message 3 of 4

brian_adams
Collaborator
Collaborator

yes, but they have no libraries.

0 Likes
Message 4 of 4

brian_adams
Collaborator
Collaborator

Actually it could be because of ACADVER

here is code for this

on error resume next
Set acadApp = GetObject(,"AutoCAD.Application")
acadVerString = acadApp.ActiveDocument.GetVariable("ACADVER")

Select Case acadVerString
Case "18.0s (LMS Tech)" 'ACA-2010
  aecBaseVer = "AecX.AecBaseApplication.6.0"
Case "18.2s (LMS Tech)" 'ACA-2012
  aecBaseVer = "AecX.AecBaseApplication.6.7"
Case "19.0s (LMS Tech)" 'ACA-2013
  aecBaseVer = "AecX.AecBaseApplication.7.0"
Case "19.1s (LMS Tech)" 'ACA-2014
  aecBaseVer = "AecX.AecBaseApplication.7.5"
Case "20.0s (LMS Tech)" 'ACA-2015
  aecBaseVer = "AecX.AecBaseApplication.7.7"
Case "20.1s (LMS Tech)" 'ACA-2016
  aecBaseVer = "AecX.AecBaseApplication.7.8"
Case "21.0s (LMS Tech)" 'ACA-2017
  aecBaseVer = "AecX.AecBaseApplication.7F9"
Case "22.0s (LMS Tech)" 'ACA-2018
  aecBaseVer = "AecX.AecBaseApplication.8.0"
Case "23.0s (LMS Tech)" 'ACA-2019
  aecBaseVer = "AecX.AecBaseApplication.8.1"
Case "23.1s (LMS Tech)" 'ACA-2020
  aecBaseVer = "AecX.AecBaseApplication.8.2"
Case Else
aecBaseVer = "Unknown"
End Select
If aecBaseVer = "Unknown" Then
  RESULT = "Unknown Version"
Else
  Set aecBase = acadApp.GetInterfaceObject(aecBaseVer)
  aecBase.Init acadApp