.NET

Reply
Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 1 of 11 (719 Views)

Issue with Model popup in autocad

719 Views, 10 Replies
09-26-2012 11:23 PM

Hi,

 

I am having issue with autocad with .net addin.

 

Here is the scenario :

 

I am showing model up of wpf application on autocad application.

 

As am showing wpf application as model popup,Once i opne the  model popups , autocad applications is in disable mode untill wpf model pop up closed. This is working fine.

But, while doing any operations in wpf model pupup, if wpf addin is throughs any exception 

Wpf model is in open,Autocad is getting enabled but is should not enable.,

 

Please help me on this.

 

Regards,

Raman

 

 

ADN Support Specialist
StephenPreston
Posts: 429
Registered: ‎05-22-2006
Message 2 of 11 (673 Views)

Re: Issue with Model popup in autocad

10-01-2012 01:41 PM in reply to: RamanSBV

Hi Raman,

 

I'n very sorry, but I don't understand your question. Please would you rewrite it more expansively. Also, providing a small sample to demonstrate the problem will help the people on this forum better understand your problem.

 

Cheers,

Stephen Preston
Autodesk Developer Network
Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 3 of 11 (650 Views)

Re: Issue with Model popup in autocad

10-03-2012 10:20 PM in reply to: StephenPreston
Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 4 of 11 (647 Views)

Re: Issue with Model popup in autocad

10-03-2012 10:30 PM in reply to: RamanSBV

Hi,

 

 

Please find the attachment with below details

 

1. Project -- solution structure with two projects.

  •  Autocad project
  •  model pupup project.

2. Netload -- Net loading the autocad dll

 

3. showmodelpopup - displaying popup using below code snippet

[CommandMethod("ShowModelPopUp")]       

publicvoid ShowModelPopUp()

 {            newModelPopUpViewModel().ShowModelPopUP();        }

 

4. Execeptionmessagefrom autocad -- Getting autocad error message

 

5. EditingAutocad -- Able to access autocad menu bar, even though model pup up is in open state.

 

 

I am facing issue as shown in image 4 (Execeptionmessagefrom). When ever some error throws from autocad main application. i will get access to autocad application access, even though model popop is open state.

 

I don't allow to access autocad application access, when model popup is in open state

 

Please help me on this.

 

Regards,

Raman

 

Valued Mentor
DiningPhilosopher
Posts: 370
Registered: ‎05-06-2012
Message 5 of 11 (574 Views)

Re: Issue with Model popup in autocad

10-05-2012 03:11 AM in reply to: RamanSBV

The only files you've posted so far are image files. 

 

I woudln't expect much in the way of help without showing the code (and when I say 'show', I don't mean an image showing the code).

Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 6 of 11 (527 Views)

Re: Issue with Model popup in autocad

10-08-2012 02:03 AM in reply to: DiningPhilosopher

Hi,

 

I am here with sample project for explaining the issue.

 

Net load the given sample project into autocad application and  given the command as "ShowModelPopUp"

 

We can see one model pop up with Button and some text.

 

On click of the button("Rise Unhandled exception"). Autocad application throws an exception message.

 

After closing the autocad error message box, I am able to access autocad application, even though the model pop up is in open state., Actually i should not allow user to access autocad application and show model pop up.

 

Please guide me on this.

 

Regards,

Raman

 

 

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 7 of 11 (464 Views)

Re: Issue with Model popup in autocad

10-16-2012 03:55 AM in reply to: RamanSBV

Hello Raman,

 

The project that you shared is not in a buildable form. So cant really try to reproduce that behavior.

 

If you are trying to show a WPF window inside AutoCAD as a modal window then you must be using :

Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow()

 

Also, I fail to understand the reason why it is so important for you to have this modal behavior when there is an exception. If there is an exception, AutoCAD will try and want to grab the user's attention to submit a CER which is mostly what a user would want to do in such a scenario.

 

 

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 8 of 11 (408 Views)

Re: Issue with Model popup in autocad

11-14-2012 09:32 PM in reply to: Balaji_Ram

Hi,

 

Thanks for your response on this issue.

 

As you have mentioned above post, I have used below statement for opening model pop up

 

Autodesk.AutoCAD.ApplicationServices.Application.ShowModalWindow().

 

Now, on getting error,  model popup is not minimizing , that's what I am excepting.

 

One issue here is, even though, model pop up is open on AutoCAD, I am able to access AutoCAD tool bar, that should not be.

 

Please help me on this issue

 

Regards,

Raman

*Expert Elite*
arcticad
Posts: 1,286
Registered: ‎06-21-2004
Message 9 of 11 (358 Views)

Re: Issue with Model popup in autocad

11-16-2012 01:14 PM in reply to: RamanSBV

Can you post some code showing the error?

 

Also why can't you use a palette? I have programs that bring up palettes automatically while in a command and automatically disappear when the comment ends. If you want i can post some code.

---------------------------



(defun botsbuildbots() (botsbuildbots))
Valued Contributor
RamanSBV
Posts: 88
Registered: ‎02-28-2012
Message 10 of 11 (306 Views)

Re: Issue with Model popup in autocad

12-04-2012 02:40 AM in reply to: arcticad

Hi,

 

I am here with sample project.

 

Please netload the dll named "IssuewWithModelPopup.dll"

 

After loading above dll to autocad application

 

Enter command as "SHOWAUTOCADMODELPOPUP" 

 

We will get one popup with button text "Rise Unhandled exception".

 

On Click of button we will get autocad exception dialog.

 

Once i closed, autocad exception dialog,

Autocad is getting enabled but is should not enable.,

 

Please help me on this.

 

Regards,

Raman

 

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.