2020 VBA can't find Property Set Definitions

2020 VBA can't find Property Set Definitions

FrankMayfield
Enthusiast Enthusiast
1,982 Views
7 Replies
Message 1 of 8

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 Mayfield


EESignature

0 Likes
Accepted solutions (1)
1,983 Views
7 Replies
Replies (7)
Message 2 of 8

Ed__Jobe
Mentor
Mentor

You mentioned that you checked for missing references. Did you check to see that AEC Schedule was the correct version? I'm on 2018 and its version 8.0. Not sure what version 2020 uses. It could be the same though.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 3 of 8

FrankMayfield
Enthusiast
Enthusiast

Yes, I checked that too and verified that it is version 8.2  (attached is ref screenshot)


Frank Mayfield


EESignature

0 Likes
Message 4 of 8

Ed__Jobe
Mentor
Mentor

How about that reference to acad 2019? Does the pc have 2019 installed too? Do the references list a tlb for 2020? Are you sure you're actually opening 2020? e.g. double clicking on a dwg could open 2019 if it was the last used. Its important that you don't try to use the same dvb for multiple years/versions of acad.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 5 of 8

Ed__Jobe
Mentor
Mentor

I checked with another EE and apparently 2020 still uses the 2019 tlb.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 6 of 8

Ed__Jobe
Mentor
Mentor

Do you know how to debug in vba? If so, can you set a breakpoint at the Set line and inspect the value of the variable after you execute that line?

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes
Message 7 of 8

FrankMayfield
Enthusiast
Enthusiast

Ed,

Yeah, I've done that. Attached is a screenshot showing the same code, same drawing, same breakpoint, and same watches - with 2017 on top, and 2020 underneath (bottom). As you can see, it fails to find the PSD.

 

I've done a screenshare with someone else (who's pretty good at VBA) and it had him dumbfounded. As AUGI brethren, I'd be glad to let you take over and poke around. I'm at a loss.

 

BTW, thanks for trying to help. I'll buy you a free beer if you're at AU this year.

 

 


Frank Mayfield


EESignature

0 Likes
Message 8 of 8

Ed__Jobe
Mentor
Mentor
Accepted solution

After a conference call, we determined that the problem was with 2019 and 2020 being installed on the same pc was causing issues with references. The correct file was being referenced in 2020 though.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

0 Likes