| Author |
Message |
John
Guest
|
Posted:
Wed Dec 15, 2004 12:50 am Post subject:
A VBA Newbie |
|
|
Hello everyone,
I'm tryting to learn VBA and I have some experience in Lisp. I'm playing
with VBA from last few weeks so I think i got some basic stuff. here is my
first CODE in VBA.
Public Sub testforplot()
Dim pagesetups As AcadPlotConfigurations
Dim pagesetup As AcadPlotConfiguration
Dim newpage1 As AcadPlotConfiguration
Set pagesetups = ThisDrawing.PlotConfigurations
Set newpage1 = ThisDrawing.PlotConfigurations.Add("test")
newpage1.PlotRotation = ac270degrees
newpage1.PlotType = acLayout
newpage1.PlotWithPlotStyles = True
newpage1.ConfigName = "Plotter.pc3"
newpage1.StyleSheet = "test.STB"
newpage1.StandardScale = ac1_1
newpage1.CanonicalMediaName = "user636"
newpage1.PlotWithLineweights = True
newpage1.ScaleLineweights = True
End Sub
I know I can use WITH statement to replace all newpage1. My question is how
to make plotconfigurations (name "test") active and assign with layouts?
I'm trying to do this but with name
If PlotConfigurations.count = 0 Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
Can i go by plotconfigurations name like this
If PlotConfigurations.count = "test" Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
Thank you for your help. I will keep posting here becasue I'm VBA Newbie.
|
|
| Back to top |
|
 |
TomD
Guest
|
Posted:
Wed Dec 15, 2004 1:38 am Post subject:
Re: A VBA Newbie |
|
|
<SNIPPED>
| Quote: | I know I can use WITH statement to replace all newpage1. My question is
how
to make plotconfigurations (name "test") active and assign with layouts?
I'm trying to do this but with name
If PlotConfigurations.count = 0 Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
Can i go by plotconfigurations name like this
If PlotConfigurations.count = "test" Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
|
If I remember correctly, you have to use the CopyFrom method of the layout
to apply a PlotConfiguration's settings.
.....that's how I've been doing it, anyway. (It seemed counterintuitive, at
first.....at least to me.) |
|
| Back to top |
|
 |
John
Guest
|
Posted:
Wed Dec 15, 2004 2:02 am Post subject:
Re: A VBA Newbie |
|
|
Thank you for your reply
what i really looking is, for example if you have few plotconfiguratios in
this drawing and like to make one of them active....
"TomD" <tdivittis.no@spam.cecinc.com> wrote in message
news:41bf4f28$1_1@newsprd01...
| Quote: | SNIPPED
I know I can use WITH statement to replace all newpage1. My question is
how
to make plotconfigurations (name "test") active and assign with layouts?
I'm trying to do this but with name
If PlotConfigurations.count = 0 Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
Can i go by plotconfigurations name like this
If PlotConfigurations.count = "test" Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
If I remember correctly, you have to use the CopyFrom method of the layout
to apply a PlotConfiguration's settings.
....that's how I've been doing it, anyway. (It seemed counterintuitive,
at
first.....at least to me.)
|
|
|
| Back to top |
|
 |
Ed Jobe
Guest
|
Posted:
Wed Dec 15, 2004 2:15 am Post subject:
Re: A VBA Newbie |
|
|
He gave that to you. :-) Some code might make it clearer.
If ThisDrawing.PlotConfigurations("SomePageSetup") Then
ThisDrawing.ActiveLayout.CopyFrom ThisDrawing.PlotConfigurations
"SomePageSetup"
End If
--
----
Ed
----
"John" <hendnoemail@aol.com> wrote in message news:41bf54e6_1@newsprd01...
| Quote: | Thank you for your reply
what i really looking is, for example if you have few plotconfiguratios in
this drawing and like to make one of them active....
"TomD" <tdivittis.no@spam.cecinc.com> wrote in message
news:41bf4f28$1_1@newsprd01...
SNIPPED
I know I can use WITH statement to replace all newpage1. My question
is
how
to make plotconfigurations (name "test") active and assign with
layouts?
I'm trying to do this but with name
If PlotConfigurations.count = 0 Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
Can i go by plotconfigurations name like this
If PlotConfigurations.count = "test" Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
If I remember correctly, you have to use the CopyFrom method of the
layout
to apply a PlotConfiguration's settings.
....that's how I've been doing it, anyway. (It seemed counterintuitive,
at
first.....at least to me.)
|
|
|
| Back to top |
|
 |
John
Guest
|
Posted:
Wed Dec 15, 2004 6:11 pm Post subject:
Re: A VBA Newbie |
|
|
Thanks, Yes, he gave to me but I'm new so I get little slow...:) And i got
confuse about this "copyfrom"...... I was thinking that statement something
like this activeplotfiguration = "test". anyway againg thanks for your help.
John
"Ed Jobe" <not.edljobe@hotmail.com> wrote in message
news:41bf57fd$1_3@newsprd01...
| Quote: | He gave that to you. :-) Some code might make it clearer.
If ThisDrawing.PlotConfigurations("SomePageSetup") Then
ThisDrawing.ActiveLayout.CopyFrom ThisDrawing.PlotConfigurations
"SomePageSetup"
End If
--
----
Ed
----
"John" <hendnoemail@aol.com> wrote in message news:41bf54e6_1@newsprd01...
Thank you for your reply
what i really looking is, for example if you have few plotconfiguratios
in
this drawing and like to make one of them active....
"TomD" <tdivittis.no@spam.cecinc.com> wrote in message
news:41bf4f28$1_1@newsprd01...
SNIPPED
I know I can use WITH statement to replace all newpage1. My question
is
how
to make plotconfigurations (name "test") active and assign with
layouts?
I'm trying to do this but with name
If PlotConfigurations.count = 0 Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
Can i go by plotconfigurations name like this
If PlotConfigurations.count = "test" Then
'*** Customize the new configuration to your satisfaction ***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
If I remember correctly, you have to use the CopyFrom method of the
layout
to apply a PlotConfiguration's settings.
....that's how I've been doing it, anyway. (It seemed
counterintuitive,
at
first.....at least to me.)
|
|
|
| Back to top |
|
 |
TomD
Guest
|
Posted:
Wed Dec 15, 2004 7:55 pm Post subject:
Re: A VBA Newbie |
|
|
"John" <hendnoemail@aol.com> wrote in message news:41c03800_2@newsprd01...
| Quote: | Thanks, Yes, he gave to me but I'm new so I get little slow...:) And i
got
confuse about this "copyfrom"...... I was thinking that statement
something
like this activeplotfiguration = "test". anyway againg thanks for your
help. |
Sorry about the lack of info, John. I'll take full blame for that post not
being clear enough. ;) |
|
| Back to top |
|
 |
Ed Jobe
Guest
|
Posted:
Wed Dec 15, 2004 9:14 pm Post subject:
Re: A VBA Newbie |
|
|
No problem. You can also look up CopyFrom in help for an example and what
other objects use this method.
--
----
Ed
----
"John" <hendnoemail@aol.com> wrote in message news:41c03800_2@newsprd01...
| Quote: | Thanks, Yes, he gave to me but I'm new so I get little slow...:) And i
got
confuse about this "copyfrom"...... I was thinking that statement
something
like this activeplotfiguration = "test". anyway againg thanks for your
help.
John
"Ed Jobe" <not.edljobe@hotmail.com> wrote in message
news:41bf57fd$1_3@newsprd01...
He gave that to you. :-) Some code might make it clearer.
If ThisDrawing.PlotConfigurations("SomePageSetup") Then
ThisDrawing.ActiveLayout.CopyFrom ThisDrawing.PlotConfigurations
"SomePageSetup"
End If
--
----
Ed
----
"John" <hendnoemail@aol.com> wrote in message
news:41bf54e6_1@newsprd01...
Thank you for your reply
what i really looking is, for example if you have few plotconfiguratios
in
this drawing and like to make one of them active....
"TomD" <tdivittis.no@spam.cecinc.com> wrote in message
news:41bf4f28$1_1@newsprd01...
SNIPPED
I know I can use WITH statement to replace all newpage1. My
question
is
how
to make plotconfigurations (name "test") active and assign with
layouts?
I'm trying to do this but with name
If PlotConfigurations.count = 0 Then
'*** Customize the new configuration to your satisfaction
***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
Can i go by plotconfigurations name like this
If PlotConfigurations.count = "test" Then
'*** Customize the new configuration to your satisfaction
***
PlotConfigurations.Add "NEW_CONFIGURATION"
End If
If I remember correctly, you have to use the CopyFrom method of the
layout
to apply a PlotConfiguration's settings.
....that's how I've been doing it, anyway. (It seemed
counterintuitive,
at
first.....at least to me.)
|
|
|
| Back to top |
|
 |
|
|
|
|