.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Editor.GetKeywords - Fatal Error

7 REPLIES 7
Reply
Message 1 of 8
Martin60
469 Views, 7 Replies

Editor.GetKeywords - Fatal Error

The following code gives a fatal error in AutoCAD 2008 - any ideas

Imports Autodesk.AutoCAD.ApplicationServices
Imports Autodesk.AutoCAD.EditorInput
Imports Autodesk.AutoCAD.Runtime

Public Class DEPClass


_
Public Sub PlotSettings()
PlotSettingsRead()
End Sub
_
Public Sub PlotDEP()
Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument
Dim pKeyOpts As PromptKeywordOptions = New PromptKeywordOptions("")
pKeyOpts.Message = vbLf & "Enter an option "
pKeyOpts.Keywords.Add("a4")
pKeyOpts.Keywords.Add("a3")
pKeyOpts.Keywords.Add("A2")
pKeyOpts.Keywords.Add("A1")
pKeyOpts.Keywords.Add("A1FIT")
pKeyOpts.Keywords.Add("PDF")
pKeyOpts.AllowNone = False
'Fatal Errors on next line
Dim pKeyRes As PromptResult = acDoc.Editor.GetKeywords(pKeyOpts)
Application.ShowAlertDialog("Entered keyword: " & pKeyRes.StringResult)
End Sub
End Class Edited by: fea.solutions@gmail.com on Nov 11, 2009 4:52 AM
7 REPLIES 7
Message 2 of 8
Martin60
in reply to: Martin60

This error was experienced when testing the code in debug mode.
When I published the project and tested it worked with no problems.


I am new to VB.Net and this is my first project.
I utlised the template provided by Jerry Winters with the VB.NET Programing for AutoCAD book.
As such I have not investigated the whole debugging process.

Any comments would be appreciated.
Regards
Martin
Message 3 of 8
Hallex
in reply to: Martin60

I can't rich at the moment at VS thus
I can't test it
Perhaps, like this:
{code}
pKeyOpts.Keywords.Add("a4")
pKeyOpts.Keywords.Add("a3")
pKeyOpts.Keywords.Add("A2")
pKeyOpts.Keywords.Add("A1")
pKeyOpts.Keywords.Add("A1FIT")
pKeyOpts.Keywords.Add("PDF")
pKeyOpts.AllowNone = True
pKeyOpts.Keywords.Default = "a4";
{/code}

~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Message 4 of 8
jerrywinters
in reply to: Martin60

Martin,

I ran your PlotDEP code without any problems. I am guessing this is part of a larger project. Is it possible that something else is having problems? Can you post the code that is calling PlotDEP?

Jerry
Message 5 of 8
Martin60
in reply to: Martin60

Hi Jerry
I have attached my project as is.
I am currently wotking on it so there are some linked modules missing but these are not used by the PlotDEP command.

I had assumed this problem was related to being in debug mode.
I have had a similar problem reading from the registry.
When I run the function in debug the dll resides on our server. This is becouse all my project files are on my H: for backing up etc.
When I move the dll to c: no problem.

This is my first .net project 🙂

Regards
Martin
Message 6 of 8
jerrywinters
in reply to: Martin60

What OS are you using?

Jerry
Message 7 of 8
Martin60
in reply to: Martin60

Windows XP with SP2
Message 8 of 8
Anonymous
in reply to: Martin60

.NET dlls can't be loaded across a network without first configuring them to
increase their trust level.

You can use caspol.exe from the SDK or the .NET 2.0 Configuration management
console applet (mscorcfg.msc) to do that.

You should find the latter in Start Menu->Programs->Adminstrative Tools,
"Microsoft

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD
Supporting AutoCAD 2000 through 2010

http://www.acadxtabs.com

Email: string.Format("{0}@{1}.com", "tonyt", "caddzone");

wrote in message news:6290775@discussion.autodesk.com...
Hi Jerry
I have attached my project as is.
I am currently wotking on it so there are some linked modules missing but
these are not used by the PlotDEP command.

I had assumed this problem was related to being in debug mode.
I have had a similar problem reading from the registry.
When I run the function in debug the dll resides on our server. This is
becouse all my project files are on my H: for backing up etc.
When I move the dll to c: no problem.

This is my first .net project 🙂

Regards
Martin

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost