Plot styles problem

Plot styles problem

Anonymous
Not applicable
335 Views
1 Reply
Message 1 of 2

Plot styles problem

Anonymous
Not applicable
Hi
i need to change some values in the pagesetup on each paperspace layout.
Origin, papersize, plottername the code works it chanes all the values but
on the screen there is not the correct information.
I need to start the pagesetup command and close the dialogbox with the OK
button, then evrything is ok.

Do i need to do more regen , updates or things like this in my code, or is
it a bug in the layout object?


Regards
Erich

''''''
For Each myLayout In ThisDrawing.Layouts
newValue(0) = 25
newValue(1) = 25
myLayout.ConfigName = "Test.ctb"
myLayout.StyleSheet = "Test.pc3"
If myLayout.ModelType = False Then
myLayout.PlotType = acLayout
myLayout.PlotOrigin = newValue
If InStr(1, myLayout.Name, " L") > 0 Then
myLayout.CanonicalMediaName = "User258"
End If
If InStr(1, myLayout.Name, " R") > 0 Then
myLayout.CanonicalMediaName = "User257"
End If
If InStr(1, myLayout.Name, " G") > 0 Then
myLayout.CanonicalMediaName = "User259"
newValue(1) = 5
myLayout.PlotOrigin = newValue
End If
myLayout.RefreshPlotDeviceInfo

End If
Next
0 Likes
336 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
This is a bug, as far as I can tell. Something with STB and CTB information.
You can not get to or change the info until the Pagesetup box has been
opened in that session of AutoCAD. It does not even have to in that drawing,
just within that session.

The only way I could find to get around was to use to use the following.

Public Sub PGSETUP()
AppAcad.Visible = True
AppActivate AppAcad.Caption
AppAcad.ActiveDocument.SendCommand "regen "
SendKeys "{p}", True
SendKeys "{a}", True
SendKeys "{g}", True
SendKeys "{e}", True
SendKeys "{s}", True
SendKeys "{e}", True
SendKeys "{t}", True
SendKeys "{u}", True
SendKeys "{p}", True
SendKeys "{ENTER}", True
SendKeys "{ENTER}", True
AppAcad.Visible = False
End Sub

I know its bad practices, but it is the only way I could find.

You will note that I had to send use the send key method rather than the
sendcommand function. I am not sure why but it doesn't seem to work with
sendcommand.

Mike Martin
INCAT

"Erich Heiz" wrote in message
news:[email protected]...
> Hi
> i need to change some values in the pagesetup on each paperspace layout.
> Origin, papersize, plottername the code works it chanes all the values but
> on the screen there is not the correct information.
> I need to start the pagesetup command and close the dialogbox with the OK
> button, then evrything is ok.
>
> Do i need to do more regen , updates or things like this in my code, or is
> it a bug in the layout object?
>
>
> Regards
> Erich
>
> ''''''
> For Each myLayout In ThisDrawing.Layouts
> newValue(0) = 25
> newValue(1) = 25
> myLayout.ConfigName = "Test.ctb"
> myLayout.StyleSheet = "Test.pc3"
> If myLayout.ModelType = False Then
> myLayout.PlotType = acLayout
> myLayout.PlotOrigin = newValue
> If InStr(1, myLayout.Name, " L") > 0 Then
> myLayout.CanonicalMediaName = "User258"
> End If
> If InStr(1, myLayout.Name, " R") > 0 Then
> myLayout.CanonicalMediaName = "User257"
> End If
> If InStr(1, myLayout.Name, " G") > 0 Then
> myLayout.CanonicalMediaName = "User259"
> newValue(1) = 5
> myLayout.PlotOrigin = newValue
> End If
> myLayout.RefreshPlotDeviceInfo
>
> End If
> Next
>
>
0 Likes