Current PlotConfiguration
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Current PlotConfiguration

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
John Avitt
Guest





Posted: Fri Apr 01, 2005 1:59 am    Post subject: Current PlotConfiguration Reply with quote

How can I get the name of the current PlotConfiguration (i.e., the current
Page Setup)?

Thank you.

John

Back to top
Ed Jobe
Guest





Posted: Fri Apr 01, 2005 5:29 am    Post subject: Re: Current PlotConfiguration Reply with quote

I havn't found that vba exposes that info, its just the current layout's
settings. I use the attached lisp to return it to vba. You can then return
it to vba from lisp with the following code. Note that vlax refers to a
class file that should be available as a download if you search this forum.

Public Function GetCurrentPlotConfig(LayoutName As String)
'Returns the name of the current PlotConfig for the specified layout
'Must do this though lisp because vba does not expose this property.
'
Dim vl As VLAX
Dim strPC As String
Set vl = New VLAX
'make sure lisp function (CurrentPlotConfig) is loaded
vl.EvalLispExpression ("(if (null CurrentPlotConfig)(load
""CurrentPlotConfig.lsp""))")
strPC = "(CurrentPlotConfig """ & LayoutName & """)"
strPC = vl.EvalLispExpression(strPC)
Set vl = Nothing
GetCurrentPlotConfig = strPC
End Function

--
----
Ed
----
"John Avitt" <sorry@nospam.net> wrote in message
news:424c6492$1_3@newsprd01...
Quote:
How can I get the name of the current PlotConfiguration (i.e., the current
Page Setup)?

Thank you.

John



Back to top
John Avitt
Guest





Posted: Fri Apr 01, 2005 6:56 pm    Post subject: Re: Current PlotConfiguration Reply with quote

Thank you for your reply.

One thing I have tried, unsuccessfully, is to set the USERS1 system variable
from within AutoLISP to the name of the current configuration, then extract
it in VBA with AcadDocument.GetVariable("USERS1"). I can't seem to get it to
work. It always returns an empty string.

Thank you.

John


"Ed Jobe" <not.edljobe@hotmail.com> wrote in message
news:424c959c$1_1@newsprd01...
Quote:
I havn't found that vba exposes that info, its just the current layout's
settings. I use the attached lisp to return it to vba. You can then return
it to vba from lisp with the following code. Note that vlax refers to a
class file that should be available as a download if you search this
forum.

Public Function GetCurrentPlotConfig(LayoutName As String)
'Returns the name of the current PlotConfig for the specified layout
'Must do this though lisp because vba does not expose this property.
'
Dim vl As VLAX
Dim strPC As String
Set vl = New VLAX
'make sure lisp function (CurrentPlotConfig) is loaded
vl.EvalLispExpression ("(if (null CurrentPlotConfig)(load
""CurrentPlotConfig.lsp""))")
strPC = "(CurrentPlotConfig """ & LayoutName & """)"
strPC = vl.EvalLispExpression(strPC)
Set vl = Nothing
GetCurrentPlotConfig = strPC
End Function

--
----
Ed
----
"John Avitt" <sorry@nospam.net> wrote in message
news:424c6492$1_3@newsprd01...
How can I get the name of the current PlotConfiguration (i.e., the
current
Page Setup)?

Thank you.

John







Back to top
John Avitt
Guest





Posted: Fri Apr 01, 2005 7:16 pm    Post subject: Re: Current PlotConfiguration Reply with quote

I don't know what I was doing wrong, but it is working now. I use the
SendCommand method to run an AutoLISP function that sets the USERS1 system
variable to the current plot configuration name, then I use the GetVariable
method to retrieve its value.

Thank you.

John


"John Avitt" <sorry@nospam.net> wrote in message
news:424d52ca$1_3@newsprd01...
Quote:
Thank you for your reply.

One thing I have tried, unsuccessfully, is to set the USERS1 system
variable from within AutoLISP to the name of the current configuration,
then extract it in VBA with AcadDocument.GetVariable("USERS1"). I can't
seem to get it to work. It always returns an empty string.

Thank you.

John


"Ed Jobe" <not.edljobe@hotmail.com> wrote in message
news:424c959c$1_1@newsprd01...
I havn't found that vba exposes that info, its just the current layout's
settings. I use the attached lisp to return it to vba. You can then
return
it to vba from lisp with the following code. Note that vlax refers to a
class file that should be available as a download if you search this
forum.

Public Function GetCurrentPlotConfig(LayoutName As String)
'Returns the name of the current PlotConfig for the specified layout
'Must do this though lisp because vba does not expose this property.
'
Dim vl As VLAX
Dim strPC As String
Set vl = New VLAX
'make sure lisp function (CurrentPlotConfig) is loaded
vl.EvalLispExpression ("(if (null CurrentPlotConfig)(load
""CurrentPlotConfig.lsp""))")
strPC = "(CurrentPlotConfig """ & LayoutName & """)"
strPC = vl.EvalLispExpression(strPC)
Set vl = Nothing
GetCurrentPlotConfig = strPC
End Function

--
----
Ed
----
"John Avitt" <sorry@nospam.net> wrote in message
news:424c6492$1_3@newsprd01...
How can I get the name of the current PlotConfiguration (i.e., the
current
Page Setup)?

Thank you.

John







Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB