More help needed on Layouts

More help needed on Layouts

Anonymous
Not applicable
226 Views
6 Replies
Message 1 of 7

More help needed on Layouts

Anonymous
Not applicable
I'm having a hard time adding a layout then making the new layout current.
I can add the new one just fine, but I can't get it to become active using
code.

Thanx in advance
Michael Browne
0 Likes
227 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
Try posting the code you're having the problem with,
as it's hard for someone to guess what it does.

Otherwise, this should do it:

set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")

Michael Browne wrote:
>
> I'm having a hard time adding a layout then making the new layout current.
> I can add the new one just fine, but I can't get it to become active using
> code.
>
> Thanx in advance
> Michael Browne

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 3 of 7

Anonymous
Not applicable
Tony,

That doesn't want to work either. Here's my code. Its inside a form that
has a textbox
and two buttons

Private Sub CommandButton1_Click()

Set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")

Unload Me
End Sub

Thanks for the help
Michael Browne

Tony Tanzillo wrote in message <[email protected]>...
>Try posting the code you're having the problem with,
>as it's hard for someone to guess what it does.
>
>Otherwise, this should do it:
>
>set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
>
>Michael Browne wrote:
>>
>> I'm having a hard time adding a layout then making the new layout
current.
>> I can add the new one just fine, but I can't get it to become active
using
>> code.
>>
>> Thanx in advance
>> Michael Browne
>
>--
>/*********************************************************/
>/* Tony Tanzillo Design Automation Consulting */
>/* Programming & Customization for AutoCAD & Compatibles */
>/* ----------------------------------------------------- */
>/* [email protected] */
>/* http://ourworld.compuserve.com/homepages/tonyt */
>/*********************************************************/
0 Likes
Message 4 of 7

Anonymous
Not applicable
Tony's code worked just fine for me. Are you getting an error message?

"Michael Browne" wrote in message
news:[email protected]...
> Tony,
>
> That doesn't want to work either. Here's my code. Its inside a form that
> has a textbox
> and two buttons
>
>
> Private Sub CommandButton1_Click()
>
> Set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
>
> Unload Me
> End Sub
>
> Thanks for the help
> Michael Browne
>
>
>
>
> Tony Tanzillo wrote in message <[email protected]>...
> >Try posting the code you're having the problem with,
> >as it's hard for someone to guess what it does.
> >
> >Otherwise, this should do it:
> >
> >set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
> >
> >Michael Browne wrote:
> >>
> >> I'm having a hard time adding a layout then making the new layout
> current.
> >> I can add the new one just fine, but I can't get it to become active
> using
> >> code.
> >>
> >> Thanx in advance
> >> Michael Browne
> >
> >--
> >/*********************************************************/
> >/* Tony Tanzillo Design Automation Consulting */
> >/* Programming & Customization for AutoCAD & Compatibles */
> >/* ----------------------------------------------------- */
> >/* [email protected] */
> >/* http://ourworld.compuserve.com/homepages/tonyt */
> >/*********************************************************/
>
>
0 Likes
Message 5 of 7

Anonymous
Not applicable
My guess is that it may be failing because the form is
active. You might want to try closing the form first,
before trying to make the layout active.

Michael Browne wrote:
>
> Tony,
>
> That doesn't want to work either. Here's my code. Its inside a form that
> has a textbox
> and two buttons
>
> Private Sub CommandButton1_Click()
>
> Set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
>
> Unload Me
> End Sub
>
> Thanks for the help
> Michael Browne
>
> Tony Tanzillo wrote in message <[email protected]>...
> >Try posting the code you're having the problem with,
> >as it's hard for someone to guess what it does.
> >
> >Otherwise, this should do it:
> >
> >set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
> >
> >Michael Browne wrote:
> >>
> >> I'm having a hard time adding a layout then making the new layout
> current.
> >> I can add the new one just fine, but I can't get it to become active
> using
> >> code.
> >>
> >> Thanx in advance
> >> Michael Browne
> >
> >--
> >/*********************************************************/
> >/* Tony Tanzillo Design Automation Consulting */
> >/* Programming & Customization for AutoCAD & Compatibles */
> >/* ----------------------------------------------------- */
> >/* [email protected] */
> >/* http://ourworld.compuserve.com/homepages/tonyt */
> >/*********************************************************/

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes
Message 6 of 7

Anonymous
Not applicable
It still does not work. The error I keep getting is:

Run-time error '438':
Object doesn't support this property or method

It does create the new layout but it just won't switch to it

Tony Tanzillo wrote in message <[email protected]>...
>My guess is that it may be failing because the form is
>active. You might want to try closing the form first,
>before trying to make the layout active.
>
>Michael Browne wrote:
>>
>> Tony,
>>
>> That doesn't want to work either. Here's my code. Its inside a form
that
>> has a textbox
>> and two buttons
>>
>> Private Sub CommandButton1_Click()
>>
>> Set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
>>
>> Unload Me
>> End Sub
>>
>> Thanks for the help
>> Michael Browne
>>
>> Tony Tanzillo wrote in message <[email protected]>...
>> >Try posting the code you're having the problem with,
>> >as it's hard for someone to guess what it does.
>> >
>> >Otherwise, this should do it:
>> >
>> >set ThisDrawing.ActiveLayout = ThisDrawing.Layouts.Add("New Layout")
>> >
>> >Michael Browne wrote:
>> >>
>> >> I'm having a hard time adding a layout then making the new layout
>> current.
>> >> I can add the new one just fine, but I can't get it to become active
>> using
>> >> code.
>> >>
>> >> Thanx in advance
>> >> Michael Browne
>> >
>> >--
>> >/*********************************************************/
>> >/* Tony Tanzillo Design Automation Consulting */
>> >/* Programming & Customization for AutoCAD & Compatibles */
>> >/* ----------------------------------------------------- */
>> >/* [email protected] */
>> >/* http://ourworld.compuserve.com/homepages/tonyt */
>> >/*********************************************************/
>
>--
>/*********************************************************/
>/* Tony Tanzillo Design Automation Consulting */
>/* Programming & Customization for AutoCAD & Compatibles */
>/* ----------------------------------------------------- */
>/* [email protected] */
>/* http://ourworld.compuserve.com/homepages/tonyt */
>/*********************************************************/
0 Likes
Message 7 of 7

Anonymous
Not applicable
Eliminate the 'Set' before ThisDrawing.ActiveLayout and
it will work:

ThisDrawing.ActiveLayout = Thisdrawing.Layouts.Add("New Layout")

Michael Browne wrote:
>
> It still does not work. The error I keep getting is:
>
> Run-time error '438':
> Object doesn't support this property or method
>
> It does create the new layout but it just won't switch to it
>

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* [email protected] */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/
0 Likes