- UID
- 1
- 积分
- 15892
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-1-3
- 最后登录
- 1970-1-1
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
ActiveX/VBA Technical Newsletter - March 2000
This document is part of AutoCAD VB(A) Newsletter Archive
/Note: Have you missed a Newsletter issue? Visit our Newsletter archive at
the following URL:/
http://adn.autodesk.com/techsupp/docs/newsletters.htm
Dear AutoCAD ActiveX/VBA developer,
1- Extending VBA at runtime
---------------------------
VB(A) is a Microsoft product licensed to Autodesk for enabling VB style
programming for customization on a number of Autodesk products such as
Actrix / AutoCAD. The current version of VBA used in AutoCAD 2000 is
version 5.3, and version 6 for Actrix 2000. One feature which is not
documented, is that the VB(A) engine has an ActiveX interface. This
gives you the ability to extend your code at runtime. The AutoCAD
IApplication interface has a VBE property which is the reference to
that extension. To make use of this extension, you need to make a
references to the
'Microsoft Visual Basic for Applications Extensibility 5.3'
from AutoCAD's VB(A). Then you will be able to benefit form all the
features that this extension has to offer.
Also you can load / save VB(A) projects from the AutoCAD ActiveX interface,
as well as executing a new VB(A) macro (i.e. AcadApplication.RunMacro()).
But, there is a defect in the AutoCAD 2000 shipping release (T.0.98) which
may cause problem in case you are using the SendCommand() method. The
solution below provides a workaround for this defect.
Sendcommand method runs asynchronously if called in VBA macro
/cgi-bin/solution.pl?SID=29983
2- Getting AutoCAD start parameters
-----------------------------------
Question
How can you obtain AutoCAD startup parameters with VBA?
Answer
Note: Refer to the Win32API.TXT document which is located in a sub
directory of Visual Studio in conjunction with the information outlined
below.
There is no direct VBA API that will allow you do this, however you can
utilize the WIN32 API to find the startup parameters for AutoCAD.
First, you should declare the Win32 function as stated in the Win32API.txt
document, which is located in a sub directory of Visual Studio. Get the
return value, (in this case, a string) by calling this function. Retrieve the
switch parameters from the return string. Please note the first parameter is
the execution program name and the parameters that follow (if any) are
separated by spaces.
Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As String
Sub GetCmdLine()
Dim str As String
str = GetCommandLine()
MsgBox "AutoCAD switches are " & str, , "Command Line"
End Sub
/cgi-bin/solution.pl?SID=41743
3- New and updated solutions
----------------------------
New and updated solutions are available at:
/scripts/whatsnew.pl
or
http://adn.autodesk.com/techsupp/apikb/whatsnew2.htm
-----------------------------------------------------------------------------
To subscribe or unsubscribe, go to
http://adn.autodesk.com/techsupp/docs/newsletters.htm
-----------------------------------------------------------------------------
You received this message as a result of your registration
on the ADN List Server subscription page. If you no longer wish
to receive these messages, read the next section, How to use this
mailing list.
How to use this mailing list:
You may unsubscribe from this e-mail newsletter, or subscribe to
a variety of other informative e-mail newsletters, by returning
to the ADN List Server subscription page at
http://adn.autodesk.com/techsupp/docs/newsletters.htm
and changing your subscription preferences.
Alternatively, from the subscribed account you can send an e-mail to
<Majordomo-partnersys@autodesk.com> with the following command in the
body of your email message:
unsubscribe <list-name>
----------------------------------------------------------------------
Autodesk Developer Network (ADN) information and events:
For information on all ADN topics, please visit:
http://www.autodesk.com/adn
----------------------------------------------------------------------
THIS DOCUMENT IS PROVIDED FOR INFORMATIONAL PURPOSES ONLY. The
information contained in this document represents the current view of
Autodesk Inc. on the issues discussed as of the date of publication.
Because Autodesk must respond to change in market conditions, it
should not be interpreted to be a commitment on the part of Autodesk
and Autodesk cannot guarantee the accuracy of any information
presented after the date of publication.
INFORMATION PROVIDED IN THIS DOCUMENT IS PROVIDED 'AS IS' WITHOUT
WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
PARTICULAR PURPOSE AND FREEDOM FROM INFRINGEMENT.
The user assumes the entire risk as to the accuracy and the use of
this document. This document may be copied and distributed subject to
the following conditions:
1. All text must be copied without modification and all pages must
be included
2. All copies must contain Autodesk's copyright notice and any other
notices provided therein
3. This document may not be distributed for profit |
|