.NET

Reply
Member
cfiene
Posts: 4
Registered: ‎09-29-2011
Message 1 of 4 (285 Views)

user forms

285 Views, 3 Replies
10-10-2012 10:36 AM

Intermediate programmer here . .

 

I developed a program in VBA that used a form to allow users to create new dwg files based on selected criteria . . . . the vba program would then create and open the new dwg file and in the case of sheet files, it would populate title block attributes as well.

 

In vba, the forms focus was carried to the new file so the application would fill in the attributes, etc. as described above,

 

However in vb.net, I have not been able to get the form to recognize the new file. The program creates and opens the file, however the forms focus is still on the initial file so any actions to be applied to the new file are not carried out.

 

Any suggestions?

 

Thanks in advance.

Board Manager
StephenPreston
Posts: 368
Registered: ‎05-22-2006
Message 2 of 4 (253 Views)

Re: user forms

10-11-2012 12:36 AM in reply to: cfiene

So you've opened a DWG in a new document and want that to become the active document? Have you tried Application.DocumentManager.MDIActiveDocument = XXX, whwre XXX is the new document you opened/created? If that doesn't help, then a code sample would help demonstrate what you're trying to do.

 

 

Cheers,

Stephen Preston
Autodesk Developer Network
Member
cfiene
Posts: 4
Registered: ‎09-29-2011
Message 3 of 4 (235 Views)

Re: user forms

10-11-2012 07:37 AM in reply to: StephenPreston

Yes, that is correct. I will try your suggestion and let yuou know.

 

Thanks very much!

Member
cfiene
Posts: 4
Registered: ‎09-29-2011
Message 4 of 4 (145 Views)

Re: user forms

01-03-2013 04:59 AM in reply to: StephenPreston

Hi Stephen,

 

I did not have a chance to look at my code for quite some time . . . some project deadlines etc . .

 

I tried your suggestion and it did not work. The error was indicating that the file name could not be a string variable. I did a little more resarch and foud that the follwing code worked:

 

Autodesk.AutoCAD.ApplicationServices.

Application.DocumentManager.Open(sNewFile, False)

 

Where sNewFile is the file I created from the applicaiton.

 

Hope this helps and thanks once again for your response.

 

Chris

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community