.NET

Reply
Active Member
583408432
Posts: 8
Registered: ‎05-11-2012
Message 1 of 3 (196 Views)
Accepted Solution

Can not display the PlotStyleDialog() dialog box

196 Views, 2 Replies
12-24-2013 04:53 AM

'I used about three methods are still not solve the problem.
Dim p As New Autodesk.AutoCAD.Windows.PlotStyleDialog()
'1.
p.ShowDialog()


'2.
p.PlotStyle = "acad.ctb"
p.ShowDialog()

'3.
p.PlotStyle = "C:\Documents and Settings\Administrator\Application Data\Autodesk\AutoCAD 2010\R18.0\chs\Plotters\Plot Styles\acad.ctb"
p.ShowDialog()

Confused met to but the solution is simple.

This PlotStyleDialog can only be used in the so called Named Plot Style drawings.

So if you're dialog does not show its probably the Color Depended drawing type -- most drawings still are.

 

You need to create a STB style first, then convert the drawing.

Try this before running the program:

Command: CONVERTCTB

    acad.ctb

    new.stb

 

Command: CONVERTPSTYLES

   new.stb

 

Command: NETLOAD

    <youreNamedDLL>

 

Command: psd

 

 

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.IO;
using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.PlottingServices;
using Autodesk.AutoCAD.Windows;
using Autodesk.AutoCAD.Publishing;
namespace PlotStyleDialog
{
public class Class1
{
[CommandMethod("psd")]
public void PlotStyleDlg()
{
var psd = new PlotStyleDialog();
DialogResult dlgRes=psd.ShowDialog();
}
}
}

 

 

 

 

Active Member
583408432
Posts: 8
Registered: ‎05-11-2012
Message 2 of 3 (149 Views)

Re: Can not display the PlotStyleDialog() dialog box

12-27-2013 08:30 PM in reply to: 583408432

The above code codes cannot show PlotStyleDialog.

Can someone solve this problem?Thanks in advance!

Mentor
SENL1362
Posts: 213
Registered: ‎07-20-2011
Message 3 of 3 (136 Views)

Re: Can not display the PlotStyleDialog() dialog box

12-28-2013 09:40 AM in reply to: 583408432

Confused met to but the solution is simple.

This PlotStyleDialog can only be used in the so called Named Plot Style drawings.

So if you're dialog does not show its probably the Color Depended drawing type -- most drawings still are.

 

You need to create a STB style first, then convert the drawing.

Try this before running the program:

Command: CONVERTCTB

    acad.ctb

    new.stb

 

Command: CONVERTPSTYLES

   new.stb

 

Command: NETLOAD

    <youreNamedDLL>

 

Command: psd

 

 

using System;
using System.Collections.Generic;
using System.Text;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using System.IO;

using acadApp = Autodesk.AutoCAD.ApplicationServices.Application;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;
using Autodesk.AutoCAD.PlottingServices;
using Autodesk.AutoCAD.Windows;
using Autodesk.AutoCAD.Publishing;




namespace PlotStyleDialog
{
    public class Class1
    {
        [CommandMethod("psd")]
        public void PlotStyleDlg()
        {
            var psd = new PlotStyleDialog();
            DialogResult dlgRes=psd.ShowDialog();
        }
     }
}

 

 

 

 

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!