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

Problem with PaletteSet location in Autocad

24 REPLIES 24
Reply
Message 1 of 25
JernejC
1914 Views, 24 Replies

Problem with PaletteSet location in Autocad

I'm having problem with chosing PalleteSetSet location in Autocad. No matter what I do, it is always docked on left side of Autocad window. My code is something like this:

PaletteSet ps;
ps = new PaletteSet("blabla", new Guid(System.Guid.NewGuid().ToString("B")));
ps.Style = PaletteSetStyles.NameEditable | PaletteSetStyles.ShowPropertiesMenu |
PaletteSetStyles.ShowAutoHideButton | PaletteSetStyles.ShowCloseButton;
ps.MinimumSize = new System.Drawing.Size(Width,Height);
ps.Size = new System.Drawing.Size(.Width,Height);
ps.DockEnabled = Autodesk.AutoCAD.Windows.DockSides.None;
ps.Add("blabla", new Palette());
ps.Visible = true;

Am I missing something? Edited by: JernejC on Sep 25, 2009 8:42 AM
24 REPLIES 24
Message 21 of 25

Hi,

 

have you found that blog:

>>>Database.ThumbnailBitmap returns Nothing when called for a side database<<<?

I think that will be the answer.

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 22 of 25

Hi alfred,

 

I have no idea what is wrong in this project 🙂

I changed like this:

public System.Drawing.Bitmap get_image_of_file(string filename)
{
//create a new database instance and load the dwg file into it.
Database dbb = new Database(false, true);
//dbb.ReadDwgFile(filename, FileOpenMode.OpenForReadAndAllShare, false, "");
dbb.ReadDwgFile(filename, FileOpenMode.OpenForReadAndReadShare, true, "");
MessageBox.Show(filename);
//grab the thumbnail bitmap and get rid of the white background
System.Drawing.Bitmap preview = dbb.ThumbnailBitmap;
// preview.MakeTransparent(System.Drawing.Color.White);

return preview;
}

and it did not work. Error is the same.

Messagebox show me path to DWG file - is correct.

 

But I thank you for your patience and help 🙂

 

My control "Palette" look like:

 

in AutoCAD (during run & debug), my Palette look like:

AutoCAD 2013 - NOT FOR RESALE - [Drawing1.dwg].jpg

 

no label.control, no background.color - This is weird, do not you think?

Maybe I do something wrong in other place?

 

regards

 

Message 23 of 25

Hi,

 

do you have an older version of AutoCAD? I did test the attached project in debug-mode (with AutoCAD 2010) and it shows the preview icon. Update the references and verify it on your system.

 

-.alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 24 of 25

Hi Alfred,

 

I don't have AutoCAD2010, but I did test in AutoCAD2012.

It's work good, but... I noticed that some of the blocks are correct, others do not.

In attached are two blocks: 2010 not read, 2011 read.

Maybe here is the problem, not in program?

 

regards

Message 25 of 25

Hi,

 

the 2010.DWG is a definition of a dynamic block, so when you open this drawing you get the question like that.

 

 

When opening your block with your preview-tool I get then this exception:

makes me thinking that opening a dynamic-blockdefinition is not supported yet by the API (at least with AutoCAD-2010).

 In this case I would understand some difficulties to querying the thumbnail from the db-object.

 

But the 2011.DWG does work with your preview (at my workstation/with AutoCAD 2010).

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)

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