implementing .dvb file from 2010 to Autocad 2016 VBAenabler 2016

implementing .dvb file from 2010 to Autocad 2016 VBAenabler 2016

Anonymous
Not applicable
1,699 Views
13 Replies
Message 1 of 14

implementing .dvb file from 2010 to Autocad 2016 VBAenabler 2016

Anonymous
Not applicable

I am planning to buy the new autocad 2016 and license all of my companies computer but we have a plugin that we have been using for years. Here's the problem. The thing is running properly on autocad 2010 with vbaenabler 2010, but when I try to load it using autocad 2010 with vbaenabler 2016, it doesn't work. What's the difference between the two? are there changes with the syntax in 2016 when writing codes? 

 

Anyway here's the 2 problem I'm facing.

 

My first problem is when I open the plugin with autocad 2016 this dialog box pops out

Capture1.PNG

 

I just press Ok, and the main module runs. what does this means?

 

second is this one :

 

I have an old plugin and it's running properly on autocad 2010, I'm trying to laod it on 2016, here's the function code

 

Private Function getRawFname(frm As Object, ByVal gsi As Boolean) As String         
If gsi Then
      frm.cmdFD.Filter = "Raw Data (*.raw)|*.raw"    
Else
      frm.cmdFD.Filter = "Comma Delimited (*.cdd)|*.cdd"    
End If   
frm.cmdFD.FilterIndex = 1    
frm.cmdFD.ShowOpen    
getRawFname = frm.cmdFD.FileName 
End Function

I haven't coded visual basic in my life before but the function above seems to determine a file type and run.

 

error: this line

 

frm.cmdFD.Filter = "Comma Delimited (*.cdd)|*.cdd" 

Capture.PNG

0 Likes
1,700 Views
13 Replies
Replies (13)
Message 2 of 14

norman.yuan
Mentor
Mentor

Firstly, if you do not know how to program in VBA, you may seek professional help if use existinig VBA is mission critical to your business before moving from Acad2010 to 2016.

 

With that said, my guess is that your issues are most likely because of using 32-bit AutoCAD2010 before and using 64-bit AutoCAD2016. That is, your existing VBA project for 32-bit Acad2010 may use some components that is not available in 64-bit (most 32-bit components used in 32-bit VB/VBA code are not available 9n 64-bit environment). 

 

So, you really need someone who knows VBA well to lexamine your exiting VBA code to decide if it can be easily migrate into 64-bit VBA. 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 14

Anonymous
Not applicable
Thanks for the reply

I tried running the VBA with autocad 2016 64bit and it's working fine.

Are you saying the issue is within the code itself? if yes, I'll learn vba right away . thanks for the input. Any tutorial you wanna suggest?
0 Likes
Message 4 of 14

Anonymous
Not applicable
I mean it's working fine with autocad 2010 64bit
0 Likes
Message 5 of 14

norman.yuan
Mentor
Mentor

OK, it is good news that the code actually runs with ACAD2010 64-bit. This would make your issue a bit easier to deal with.

 

Now that is is not 32/64-bit issue, then it looks like (again, I have to guess) the VBA project uses third party components that is not available in the Acad2016 computer. You can go to VBA Editor (at command line, enter command "VBAIDE"), and then select menu "Tools->Refernces..." to open "References" dialog box, where you can see what components/libraries your VBA project has references to (the checked ones). You may spot some of them flagged as "Missing". Those are the issues you need to deal with.

 

Of course you can do the same with your working Acad2010 version to compare the list of references.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 6 of 14

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> Now that is is not 32/64-bit issue

Is that sure?, AutoCAD 2010 had a 32bit VBA environment independent of AutoCAD itself!

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Likes
Message 7 of 14

norman.yuan
Mentor
Mentor

Yes, you are right, Alfred. It is still likely be 32/64 bit issue, because of the VBA for Acad2010 is 32-bit, in spite of AutoCAD2010 itself is 64-bit.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 8 of 14

Anonymous
Not applicable

I compared both of the list and both are equally the same. no missing components.

 

 

So I guess this problem lies in the source code itself and we have to translate it right? Any suggestions?

 

If the only solution is to translate the plugin, can I use c# or c++ and use .net framework? or autocad only supports vb language for dev'ing plugins? 

 

Thanks

0 Likes
Message 9 of 14

norman.yuan
Mentor
Mentor

As Alfred correctly pointed out, the VBA in Acad2010 (32 or 64bit) is 32bit, while in AutoCAD2016 64bit, the VBA is 64 bit. So, as my original reply said, it is very likely an 32-bit component being used that cannot run in 64-bit VBA. 

 

Unfortunately, you did not show enough code to tell what exactly causes the error. But, again if I had to guess from the few lines of code in your post, it seems that the code is to open a "OpenFileDialog" for user to select a file and this is where you get the error.

 

If this is the case, then the VBA code probably uses COMMON DIALOG component, which is 32-bit and cannot be used in 64-bit process. There is no 64-bit version of it. However, you can file workaround by using Window API (searching the net, or even this forum would lead you to the workaround). If this is your only issue with your VBA code, then you could keep using it. If your VBA project is quite complicated/mission critical, moving from 32-bit VBA to 64-bit most likely brings up other issues. You may want to migrate your VBA apps to AutoCAD .NET API.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 10 of 14

Anonymous
Not applicable

That's true, the code where it crashes is when i open a dialog box to open a file, I'm just trying to fix this line first and see if the whole program works. but the problem is this line:

 

frm.cmdFD.Filter = "Comma Delimited (*.cdd)|*.cdd"

 

frm = form, but cmdFD, I'm not sure what that is, I can't find anywhere where it's declared. could you guys give an an example snippet of a code on how to open a dialog box or related to the line above.

 

Here's the whole function declaration :

 

Private Function getRawFname(frm As Object, ByVal gsi As Boolean) As String
   If gsi Then
      frm.cmdFD.Filter = "Raw Data (*.raw)|*.raw"
   Else
      frm.cmdFD.Filter = "Comma Delimited (*.cdd)|*.cdd"
   End If
   frm.cmdFD.FilterIndex = 1
   frm.cmdFD.ShowOpen
   getRawFname = frm.cmdFD.FileName
End Function

Or if u guys have time, I'll send the app to your email. I really need to fix this. Thanks.

0 Likes
Message 11 of 14

Anonymous
Not applicable
seems like the command cmdFD is from f3dynamics.userforms my problem now is on how to referencing it. been googling around the dll and still no luck. screenshots from autocad 2010, is it possible to reference this library on 2016?
0 Likes
Message 12 of 14

Anonymous
Not applicable
I found out what cmdFD is, it's a common dialogbox inside the UI, I can't figure out how to add this in 2016.
0 Likes
Message 13 of 14

norman.yuan
Mentor
Mentor

You are wasting your time trying to fix code using 32-bit component in a 64-bit environment:

 

If I have to guess, frm.cmdFD refers to CommonDialog component, which is a 32BIT component, the original code author drag and drop onto the UserForm (referred to in the code as "frm").

 

It cannot be used/fixed in 64-bit environment, PERIOD.

 

If showing an "open file"dialog is the ONLY issue to revive your VBA project, then yes, you can find easier replacement, even in this forum, such as here:

 

http://forums.autodesk.com/t5/inventor-customization/folder-browser-needed-for-vba-7-64-bit/m-p/4365...

 

Make sure you remove the CommonDialog component from the userform.

 

Again, moving 64-bit VBA could have more issues than you expected, depending on the app's functionality. If your VBA app is mission-critical and quite large/complicated, it may not be worth the effort to make it working in 64-bit VBA.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 14 of 14

Anonymous
Not applicable
I understand, I guess I have to translate the whole thing to vb.net, like what you said, converting the whole thing to VBA 64bit compatible might face a lot of issues. I got 2 weeks to do this thing, my section is planning on getting 15 licenses(autocad 2016) and this small application is holding us back, and the author is not being helpful. could you guys point me to where I can get a freelance VB.net programmer who can translate this small application. Thanks
0 Likes