.NET
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
- you have set the property "local copy" for the references to "yes" ==> that should be "no"
Where is this position?
- how do you debug your project? When going to project-properties you have not set the "external program to start" to your ACAD.EXE or to the ACCORECONSOLE.EXE.
OK.
I've added acad.exe.
After Debug (F5), AutoCAD2013 run and show me the error message:
Application does not support just-in-time (JIT)
debugging. See the end of this message for details.
************** Exception Text **************
System.InvalidCastException: Unable to cast object of type 'Autodesk.AutoCAD.LivePreview.PreviewRuleProvider' to type 'Autodesk.AutoCAD.Internal.IPreviewContextProvider
at Autodesk.AutoCAD.LivePreview.PreviewContextService
at Autodesk.AutoCAD.LivePreview.PreviewContextService
at Autodesk.AutoCAD.LivePreview.PreviewContextManager
at System.EventHandler.Invoke(Object sender, EventArgs e)
at Autodesk.AutoCAD.ApplicationServices.Core.Applicat
************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.296 (RTMGDR.030319-2900)
CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v4.0.
----------------------------------------
Acdbmgd
Assembly Version: 19.0.0.0
Win32 Version: 19.0.55.0.0
CodeBase: file:///C:/Program%20Files/Autodesk/AutoCAD%202013
----------------------------------------
System
Assembly Version: 4.0.0.0
Win32 Version: 4.0.30319.296 built by: RTMGDR
CodeBase: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL
----------------------------------------
System.Core
Assembly Version: 4.0.0.0
I load my DLL (netload) and write PREV.
I see My Palette.
I write LDPRV, and error.
regards
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
OK. I have found this "local copy".
I changed to "False".
Now, F5 (Debbug) doesn't generate an error, but still is when I write LDPRV.
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
>> Now, F5 (Debbug) doesn't generate an error, but still is when I write LDPRV.
Ok, then next step is to tell the debugger to stop on all errors. Do that in Visual-Studio ==> pull-down-menu "debug" ==> item "exceptions" (hope that the translation from my German version is ok for that words) and within this dialog check "Common Language Runtime Exceptions".
Now exceptions raised during code will break the debugger and show you the position where the exception occured.
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
It's done.
I have found description this exception:
Do you have any idea what now?
regards
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
myPreviewBox is never set to an object (never instanciated) as this.Preview is never started.
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hmm...
in an example was:
/// <summary>
/// Instance of the Preview box
/// </summary>
PreviewBox myPreviewBox;
I have changed to:
PreviewBox myPreviewBox = new PreviewBox();
and now, the error is here:
maybe this example is incorrect and I never won't run this project?...
regards
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
does that happen with all drawings? Have you set your AutoCAD to "not save the thumbnails"?
The error seems to raise when the line above does not return a valid object (variable preview). So either there is no image in the file or the function does not return a bitmap.
(have not tried your code, so that's just guessing)
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
When I comment this line:
//grab the thumbnail bitmap and get rid of the white background
System.Drawing.Bitmap preview = dbb.ThumbnailBitmap;
//preview.MakeTransparent(System.Drawing.Color.Whi
program run propertly, but view nothing in "My Palette"...
I added Alert in this place:
Autodesk.AutoCAD.ApplicationServices.Application.S
//use the loaded dwg file to update the preview box
myPreviewBox.load_file_preview(fn.StringResult);
and show me path to my DWG file - is correct, eg. "c:\Blocks\My_blok.dwg".
"does that happen with all drawings?" - Yes.
Have you set your AutoCAD to "not save the thumbnails"? - where can I set this?
regards
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
>> Have you set your AutoCAD to "not save the thumbnails"? - where can I set this?
Command _OPTIONS ==> tab "Open and Save" ==> button "Thumbnail Preview Settings"
- alfred -
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Re: Problem with PaletteSet location in Autocad
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I have the same like you ![]()
regards



