set style sheet (plot style table) gives an error

set style sheet (plot style table) gives an error

Anonymous
Not applicable
3,140 Views
7 Replies
Message 1 of 8

set style sheet (plot style table) gives an error

Anonymous
Not applicable

Hello,

 

When I try to change the plotstyle table :

            If acDerden = True Then

                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "Dunne lijnen.ctb")

            Else

                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "HP DesignJet 500.ctb")

            End If

I get an error:

************** Exception Text **************
Autodesk.AutoCAD.Runtime.Exception: eInvalidInput
   at Autodesk.AutoCAD.DatabaseServices.PlotSettingsValidator.SetCurrentStyleSheet(PlotSettings plotSet, String styleSheetName)
   at autocad_app.vbTekening.Qplot()

 

But when I change the plot style table manualy (with plot, assign plotstyle to layout) then the error does not exist any

more.

 

0 Likes
Accepted solutions (1)
3,141 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable

The same problem by me. Anyone has a solution? Please.

0 Likes
Message 3 of 8

fieldguy
Advisor
Advisor

Are you using acPlSet.CopyFrom("whatever layout you are plotting")?  According to Kean Walmsley (http://through-the-interface.typepad.com/through_the_interface/plotting/),  "We need a PlotSettings object based on the layout settings which we then customize".

 

If your ctb file names are correct and the files exist in the location specified in the acad environment (Plot Style Table Search Path) then it should work.  You can also try the plot settings in the Autocad dialog and "Apply to Layout".  Then try your code again. 

 

0 Likes
Message 4 of 8

Anonymous
Not applicable

I found the solution by myself.

Before you change the currentstylesheet you must refresh the plotsettings

  

            acPlSetVdr.RefreshLists(acPlSet)  --> this works for me
            If acDerden = True Then
                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "Dunne lijnen.ctb")
            Else
                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "HP DesignJet 500.ctb")
            End If

 

Jacco

Message 5 of 8

Anonymous
Not applicable

Thank you for your answer. I've missed this method. I've used GetPlotStyleSheet instead, it works as well.

0 Likes
Message 6 of 8

andy62
Contributor
Contributor
Accepted solution

@Anonymous wrote:

I found the solution by myself.

Before you change the currentstylesheet you must refresh the plotsettings

  

            acPlSetVdr.RefreshLists(acPlSet)  --> this works for me
            If acDerden = True Then
                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "Dunne lijnen.ctb")
            Else
                acPlSetVdr.SetCurrentStyleSheet(acPlSet, "HP DesignJet 500.ctb")
            End If

 

Jacco


Jacco,

Thank you

it works also for me.

andy

0 Likes
Message 7 of 8

ken
Observer
Observer

Jdsmit,

Thank you so much! 

My life is worth living again!

I've been struggling thru updating a routine.

Ken

0 Likes
Message 8 of 8

Anonymous
Not applicable

This should be picked as the accepted answer. Solved the problem for me.

0 Likes