Results 1 to 7 of 7

Thread: A VBA Newbie

  1. #1
    John Guest

    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.

  2. #2
    TomD Guest
    <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.)

  3. #3
    John Guest
    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.)

  4. #4
    Ed Jobe Guest
    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.)



  5. #5
    John Guest
    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.)





  6. #6
    TomD Guest
    "John" <hendnoemail@aol.com> wrote in message news:41c03800_2@newsprd01...
    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. ;)

  7. #7
    Ed Jobe Guest
    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...
    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.)







Similar Threads

  1. Newbie
    By contrails in forum Drafting
    Replies: 1
    Last Post: 01-28-2012, 06:34 PM
  2. Someone Please Help a Newbie
    By Guido De Angelis in forum SolidWorks
    Replies: 2
    Last Post: 04-03-2005, 06:43 PM
  3. Help 4 a newbie:)
    By sent in forum AutoCAD
    Replies: 1
    Last Post: 03-28-2005, 03:57 PM
  4. Help for a Newbie.
    By Wooding in forum SolidWorks
    Replies: 2
    Last Post: 02-21-2005, 08:23 AM
  5. 3D newbie
    By andy drafter in forum Drafting
    Replies: 10
    Last Post: 12-14-2004, 11:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other forums: Access Forum - Microsoft Office Forum - Exchange Server Forum