找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1457|回复: 0

ActiveX/VBA Technical Newsletter - July 2000

[复制链接]

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-1-7 01:54:37 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
ActiveX/VBA Technical Newsletter - July 2000  
This document is part of    AutoCAD VB(A) Newsletter Archive     


AutoCAD ActiveX/VBA Technical Newsletter - July 31st. 2000
==========================================================
/Note: Have you missed a Newsletter issue? Visit our Newsletter archive at
the following URL:/

http://adn.autodesk.com/techsupp/techsupp/docs/newsletters.htm
  

Dear AutoCAD ActiveX/VBA Developer,
  

Table of Contents:
==================
1 - ADDING & REMOVING CUSTOM CONTROLS AT RUN TIME.
2 - NEW OR UPDATED DEVNOTES.
  

1 - ADDING & REMOVING CUSTOM CONTROLS AT RUN TIME
=================================================
Question:
How to add & remove custom controls such as DWGThumbnail, Volo View,
Whip etc., at run time in Visual Basic?

Answer:
To add custom controls such as DWGThumbnail, Volo View, Whip etc., at
run time we need to know the control's ProgId. The ProgId can be
obtained from the vendor of the control or by searching through the
registry.

Once the ProgId is known all that is required is to declare a control
object of the type required and add it to the form with the appropriate
ProgId.

Steps to create a sample project in VB
--------------------------------------
1. Create a new Standard.Exe project. Form1 is created by default.
2. Place two command buttons towards the bottom of the form with their
default names, leaving sufficient space at the top of the form for
the control.
3. Add the following code to the code window of Form1.

Private MyCtl As Control

Private Sub Command1_Click()
    On Error Resume Next
    'DwgThumbnail
    'Set MyCtl = Form1.Controls.Add("AUTOCAD.DwgThumbnailCtrl.1", _
    "SCtl")
  
    'Whip
    Set MyCtl = Form1.Controls.Add("WHIP.WhipCtrl.1", "SCtl")
  
    'VoloView Express
    'Set MyCtl = Form1.Controls.Add("AvViewX.AvViewX.1", "SCtl")
  
    ' show the test control.
    MyCtl.Visible = True
    MyCtl.Height = 2000
    MyCtl.Width = 2000
  
    'DwgThumbnail
    'Change the location as required
    'MyCtl.object.DwgFileName = "d:\acad2000\tmp.dwg"
  
    'Whip
    'Change the location as required
    MyCtl.object.StreamName = "d:\acad2000\model.dwf"
  
    'VoloView
    'Change the location as required
    'MyCtl.object.src = "d:\acad2000\model.dwf"
End Sub

Private Sub Command2_Click()
    On Error Resume Next
  
    'Removes the control
    Form1.Controls.Remove "SCtl"
End Sub

Uncomment the appropriate lines if you wish to use DwgThumbnail or Volo
View controls.

NOTE: Do not reference these controls in your VB project and also
please make sure that you have the controls registered properly before
executing the code.

For more information regarding adding controls and accessing the
control's events, please refer to documents Q190670 & Q188577 on the
MSDN CD collection.
  

2. - NEW OR UPDATED DEVNOTES.
=============================

RENAMING OR COPYING AN ANONYMOUS BLOCK
/cgi-bin/solution.pl?SID=55537

PURGING ANNYMOUS BLOCKS
/cgi-bin/solution.pl?SID=55997

PASSING VARIABLES BETWEEN LISP AND VBA
/cgi-bin/solution.pl?SID=57837

DELETING XDATA
/cgi-bin/solution.pl?SID=56457

CORRESPONDING BLOCKREFERENCE OF AN ATTRIBUTEREFERENCE
/cgi-bin/solution.pl?SID=56037
  
  

-----------------------------------------------------------------------------
To subscribe or unsubscribe, go to
http://adn.autodesk.com/techsupp/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/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

     ----------------------------------------------------------------------
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-12-5 03:20 , Processed in 0.403520 second(s), 37 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表