Author Topic: pinvoke PlotStyleDialog from brx13.dll  (Read 1972 times)

0 Members and 1 Guest are viewing this topic.

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
pinvoke PlotStyleDialog from brx13.dll
« on: August 27, 2013, 02:06:45 PM »
I need the plotstyle dialog from brx13.dll in Bricscad, mangled name is:
?acedPlotstyleDialog@@YA_NPEB_W_NAEAPEA_W@Z

Anyone done that pinvoke code? I am green at authoring them.
thx
James Maeding

BlackBox

  • King Gator
  • Posts: 3770
Re: pinvoke PlotStyleDialog from brx13.dll
« Reply #1 on: August 27, 2013, 02:55:24 PM »
Here's an example from my continued work on this:

Code - C#: [Select]
  1. // <snip>
  2.  
  3.     class Aced
  4.     {
  5.         [DllImport("acad.exe",
  6.             EntryPoint = "?acedHatchPalletteDialog@@YA_NPB_W_NAAPA_W@Z", // 2010, 2011, 2012
  7.             //EntryPoint = "?acedHatchPalletteDialog@@YA_NPEB_W_NAEAPEA_W@Z", // 2013, 2014, 2015?
  8.             CharSet = CharSet.Auto)]
  9.         public static extern bool HatchPalletteDialog(
  10.             string currentPattern,
  11.             bool showcustom,
  12.             out IntPtr newpattern
  13.         );
  14.     }
  15.  
  16. // <snip>
  17.  



... Sample usage:

Code - C#: [Select]
  1. // <snip>
  2.  
  3.             if (Aced.HatchPalletteDialog(hpName, true, out ptr))
  4.             {
  5.                 //<-- do something
  6.             }
  7.  
  8. // <snip>
  9.  
« Last Edit: August 27, 2013, 03:01:17 PM by BlackBox »
"How we think determines what we do, and what we do determines what we get."

LE3

  • Guest
Re: pinvoke PlotStyleDialog from brx13.dll
« Reply #2 on: August 27, 2013, 02:57:08 PM »
Post here the original usage, that might help too.

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: pinvoke PlotStyleDialog from brx13.dll
« Reply #3 on: August 27, 2013, 08:55:30 PM »
I have no original pinvoke in acad programs, as its part of Autodesk.Autocad.Windows

code is like this:

AcWn.PlotStyleDialog psd = new AcWn.PlotStyleDialog();
try {
  DialogResult dr = psd.ShowDialog();

and so on. I am adapting to bricscad and its missing from its .net api.
James Maeding

jmaeding

  • Bull Frog
  • Posts: 304
  • I'm just here for the Shelties.
Re: pinvoke PlotStyleDialog from brx13.dll
« Reply #4 on: August 27, 2013, 08:57:01 PM »
Blackbox, I will try adapting that.
James Maeding