DVB file in AutoCAD

DVB file in AutoCAD

Anonymous
Not applicable
7,989 Views
12 Replies
Message 1 of 13

DVB file in AutoCAD

Anonymous
Not applicable

R2006

 

We have a .dvb file that we load on startup.

It does some things on the begin save event.

When I bring up the VBAIDE, I can see the few subs that do the work but what I'm wondering is:

Is there or can there be other code within the .dvb file that I'm not seeing in the AutoCAD VBIDE?

 

In other words, it there the possibility of some other compiled code inside the .dvb

that does things in the background that isn't visible in the code window?

 

I'm not familiar with VB in autocad so the answer to this would help me make a decision.

 

TIA.

 

 

0 Likes
7,990 Views
12 Replies
Replies (12)
Message 2 of 13

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

within a DVB-file you can have classes, forms and modules. You can see them (if they exist) in the VB-project-explorer and all of them can hold code.

if you open them, you can see all the code and NO, there is no way to hide code, when you can open it in the editor.

 

What is possible, is that there are other VB-projects loaded that are hidden, but in that case you have also more than one DVB.

 

Could you explain what does your AutoCAD? What makes you thinking of a hidden background-process? And what is this process doing?

 

- 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 3 of 13

Anonymous
Not applicable

Thank you. Your answer helps a lot!

 

The VB program reads some attribute tags in an autocad block.

Then creates an instance of a nesting program we have installed,

then it sends the drawing information to this instance and everything shows up in the nesting program, graphics and all.

 

For the fun of it,

I rewrote the code in C# and everything compiles but when I create the instance of the nesting program,

and use the existing functions to send the drawing information, same as done in the dvb, nothing happens.

 

Just wondered if they had something else but I know that this is the only dvb we are using.

0 Likes
Message 4 of 13

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

in that case (I rewrote the code in C# [...]  same as done in the dvb, nothing happens) I would search within the new project, not in the project that did it's job yet. 😉

 

You wrote that you create an instance of (I imaging) an ActiveX-object, but what makes this happen? Does the user click a button to initialilize this or is it event-handled (before save or after open or ...)?

 

- 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 5 of 13

Anonymous
Not applicable

The begin save event starts things going.

 

My new program in C# reads the attributes and gets the string information fine.

 

The instance of the nesting program is in the Type Library supplied with the install.

 

At least I know now that something is not the same in my new program, but why?

 

0 Likes
Message 6 of 13

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> something is not the same in my new program, but why

Just guessing .... in DVB you have an object called ThisDrawing that is always showing to the current drawing.

With dotNET you have to simulate this, because there is no variable/function/property that automatically add the eventhandlers.

 

E.g. with VBA you have one sub that handles saving "ThisDrawing". In dotNET you have to set handlers for each of the open drawings or at least watch the Activated-event from the DocumentManager and set it to the current Document.

Does the user change between drawings or does he open a new or an existing drawing does not make any difference in coding for VBA, but it does for dotNET.

 

Good luck, - alfred -

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

(not an Autodesk consultant)
Message 7 of 13

Anonymous
Not applicable

Thanks.

 

I have event handlers in place and add them to existing drawings when net load.

And the purge works fine when begin save.

The end save is what triggers the nesting stuff and works fine until you actually do the automation.

I've several more things to look into and try next so thanks for the info.

0 Likes
Message 8 of 13

Anonymous
Not applicable

Must be something else that is the problem.

 

When I create the instance of the nesting application in a netloadable .dll:

 

SNAutomationClass objsn = new SNAutomationClass():

 

or (I've tried both):

 

SNAutomation objsn = new SNAutomation();

 

The program just quits working.

 

I've posted this on the .net forums too.

 

 

 

 

 

0 Likes
Message 9 of 13

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

are you running plain AutoCAD or do you have a vertical product like Mech or MEP or ACA or ....?

Because I don't know a objecttype SNAutomation and so I can't give any input for how to handle this. If it's a class you created then you should look into the code of the "New"-part of your class.

 

Sorry, - 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 10 of 13

Anonymous
Not applicable

Plain AutoCAD.

 

Thanks!

0 Likes
Message 11 of 13

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

and you have added the references to whatever holds the declaration to "SNAutomation"?

 

>> The program just quits working.

Are you running in debug-mode? If so it's unusual that visual-studio quits out without any message.

 

Try to create a small sample-application with your library to "SNAutomation" just to see it's working.

 

Good luck, - 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 12 of 13

Anonymous
Not applicable

@Alfred.NESWADBA wrote:

 Try to create a small sample-application with your library to "SNAutomation" just to see it's working. 

Good luck, - alfred -



Thanks!

 

I separated the app down to where it does the work.

I am now getting some errors reported at runtime through the catch block,

so it should give me something to go on.

 

I'll get back with the results.

 

 

 

0 Likes
Message 13 of 13

Anonymous
Not applicable

Just a follow up:

 

After the creation of the instance,

I ran just the one line that sends the part over to SN and have found success.

I still have a long way to go but it's a start.

 

The main problem seems to be in one or more of the other lines of code.

 

Thanks again Alfred!  :^)

 

 

0 Likes