找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 2284|回复: 0

ObjectARX Technical Newsletter - October 1999

[复制链接]

已领礼包: 145个

财富等级: 日进斗金

发表于 2002-1-7 02:27:40 | 显示全部楼层 |阅读模式

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

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

×
ObjectARX Technical Newsletter - October 1999  
This document is part of    ObjectARX Newsletter Archive     



Dear ObjectARX Developer,

/Note: the URLs in this posting may be broken into several lines by the
transmission media. Please make sure that you have the full URL before
trying to access it./

Table of Contents
=================
(1) AutoCAD Design Center
(2) AutoCAD OPM (Object Property Manager)
(3) New or Updated Solutions
(4) Check out DevCon presentations on the ADN WEB site
(5) ObjectARX Training Schedule

(1) AutoCAD Design Center
=========================

Design Center is a content browser within AutoCAD 2000. Design Center allows
you to view files on your file system, and with it you can see virtual
contents in files. It also allows you to open drawing files including
external references, drag and drop content (for example blocks, layers in
drawing) from a file open in design center to an open document. It can be
customized through COM to display custom content. It has powerful search
capabilities, like searching all drawings with specific block name etc.
It also allows users to insert drawings as attachments or blocks using
"Find" dialog box.

AutoCAD Design Center provides an API that can be used to provide
information
about the content that it exposes. This API consists of four Component
Object
Model (COM) interfaces for management of content. Two of these interfaces
(IAcDcContentBrowser and IAcDcContentView) are designed to enable the
component provider to display their content in AutoCAD Design Center, and
the
remaining two interfaces (IAcDcContentFinder and IAcDcContentFinderSite) are
designed to enable the component provider to participate in the 'Find'
mechanism of AutoCAD Design Center. The interfaces are described in the
following sections. There is also another interface (IAcPostDrop) that
component providers can implement to handle custom right-click drag of items
from AutoCAD Design Center.

- IAcDcContentBrowser Interface

This interface is implemented in the AutoCAD Design Center framework and is
used by the components to communicate 'get' and 'set' information. A pointer
to this interface will be given to the components when their initialization
method is called and the components are expected to cache this pointer to
talk back to the framework.

- IAcDcContentView Interface

This interface is implemented by the components and is used by the AutoCAD
Design Center framework to obtain content information from the component.
A component that has registered itself as a content provider to the AutoCAD
Design Center would be queried for this interface and at the appropriate
time, will be asked to initialize itself. Once initialized, functions in
this interface will be called at various times to 'get' or 'set' information
in AutoCAD Design Center.

- IAcDcContentFinder Interface

This interface is implemented by the components and is used by the AutoCAD
Design Center framework to obtain search information from the components.
A component that has registered itself as a content provider to AutoCAD
Design Center would be queried for this interface at the appropriate time
and will be asked to initialize itself. Once initialized, functions in this
interface will be called at various times to get information appropriate
for the Finder dialog in the AutoCAD Design Center.

-  IAcDcContentFinderSite Interface

This interface is implemented in the AutoCAD Design Center framework and is
used by the components to provide search results of a content type.

In order for your component to be seen by the AutoCAD Design Center, it must
be properly registered. This means it has to be included in AutoCAD Design
Center's registry entries. To obtain the correct registry path, first get
the
initial AutoCAD path. This can be accomplished by using the acrxProductKey()
function. Append '\AutodeskApps\AcadDC' to the initial path to complete the
AutoCAD Design Center path. Under the AutoCAD Design Center path are keys
for
content provider applications. The following paragraphs describe the main
keys
and their specific subkeys.

- Applications Key

This key is for content providers who want to register themselves and
participate in AutoCAD Design Center custom mode. We are going to make
use of this key.

- Extensions Key

This key is for content providers who want to register themselves and
participate in AutoCAD Design Center desktop mode (this mode is used to
display simple files and containers for e.g. ADT uses desktop mode).
These content providers handle only particular types of extensions, and they
are not interested in participating in the custom mode setting of AutoCAD
Design Center. We will not make use of this key in this tutorial, as we are
interested only in custom mode setting.

- CLASSID Registration

Minimum registration required by the component under HKEY_CLASSES_ROOT.
We are going to initialize this key.
  

The complete AutoCAD Design Center extension tutorial is available for
download at:

/adnhttp://adn.autodesk.com/techsupp/utilitiestechpapers.htm

Select the 'Extending AutoCAD Design Center' link.
  

(2) AutoCAD OPM (Object Property Manager)
=========================================

Dynamic Properties are defined at runtime by an ObjectARX application and
registered with the AutoCAD Object Property Manager (OPM), who in turn,
displays the properties in its render window. The property render window is
a generic property window, where AutoCAD displays several properties, and
where the user can enter or select new values for the properties. OPM works
in three different modes:

- Zero selection mode

This is the mode when no entity is selected and when no command is active.
In this mode AutoCAD displays the general drawing properties (like the
current view settings).

- Entity selection mode

When a graphical entity has been selected, OPM switches to this mode. Here
the user can see the properties of the selected entity. If the user
selected more than one entity, OPM displays the common properties.

- Command mode

An AutoCAD command can define dynamic properties, and when the user executes
the command, OPM displays the properties.

Only the 'Entity selection mode' is currently programmable, so an ObjectARX
application can register dynamic properties for entities, not for commands
or for the zero selection mode.

OPM controls the dynamic properties. When the render window is open, and a
user selects graphical entities, or when the user starts a command which has
dynamic properties, OPM displays the properties and the values associated
with them. The user can change the value of the property in the render
window, and OPM updates the property with the new value. Depending on the
property type, OPM uses different controls to let the user change the
values. It provides three controls, which you can use for your properties:
an edit box, a combo box and an Ellipses button.

* Dynamic properties for entities

Every AutoCAD entity and every entity which is defined by an ObjectDBX/ARX
application already have predefined so called static properties. OPM
displays these static properties in its render window. Static properties
are defined at compile time and cannot be changed afterwards.

You can attach new properties to already existing entities using dynamic
properties. When the property render window is open and when the user
selects an entity, OPM queries the dynamic properties attached to the
selected object(s). When you define a new dynamic property, you can specify
for which class you want to register it. This registered class and every
class derived from it have this property attached to it. For example you
can register one dynamic property for the class AcDbCurve. Whenever an
entity that is derived from AcDbCurve gets selected, OPM queries the static
properties attached to AcDbCurve and displays them in its render window as
well as the custom dynamic properties.

When you define a new dynamic property, you can specify a category that your
property belongs to. If you don't implement a category, OPM adds your
property to the category 'General', and if this category is not there, it is
created automatically. You will see later in this newsletter how you can
implement your own category, and how you can tell OPM which type of property
you have defined, and which control should be used to enter or select new
values.

* Dynamic properties for commands

As mentioned earlier, currently it's not possible to define dynamic
properties for commands. This will change in future releases of AutoCAD.
However, some AutoCAD commands are using this feature already, so let me
explain what will be possible in the future.

Just as you can define dynamic properties for existing entities, it will be
possible to define dynamic properties for your ObjectARX defined commands
(it is not possible to define properties for a command defined via
acedDefun()). You can use this feature to display settings and options of
your command in the property render window.

One more time: some standard AutoCAD commands can display their options and
properties in the OPM render window, but regrettably in this release of
AutoCAD 2000 this cannot be done for our custom ObjectARX commands.

Note:
Later we will take a look at some source code created by a wizard. The
created code is already able to handle dynamic properties for commands,
but AutoCAD is not. Please keep this in mind.

* How does OPM work?

OPM can get pointers to interfaces of dynamic properties. To get a pointer
to such an interface, OPM uses the interface IPropertyManager. This
interface implements methods to register/unregister dynamic properties at
runtime. Every AcRxClass in AutoCAD has an associated object that implements
the IPropertyManager interface, so you can define for every class a dynamic
property. Internally AutoCAD associates the object, which implements the
IPropertyManager interface, with an AcRxClass via protocol extensions.

This implementation of dynamic properties is the reason why it won't be
possible to define a dynamic property for a command which is registered
via acedDefun(). When using acedDefun(), you only specify a function
pointer for your command. When you use the addCommand() method of
AcEdCommandStack to register a command, you create a new instance of the
class AcEdCommand, which is derived from AcRxClass.

The ObjectARX SDK provides two macros that return the object which
implements the IPropertyManager interface. You have to distinguish between
command classes and AcDb classes. Use the macro GET_OPMPROPERTY_MANAGER to
get the object property manager of an AcDb class, and
GET_OPM_COMMAND_PROPERTY_MANAGER (in the future) to get the property manager
of a command (AcEdCommand class).
  

The complete AutoCAD Design Center extension tutorial is available for
download at:

http://adn.autodesk.com/techsupp/utilitiestechpapers.htm

Select the 'Dynamic Property for OPM' link.
  

(3) New or Updated Solutions
============================

UNDERSTANDING OBJECTDBX
/cgi-bin/solution.pl?SID=29575

USING A CUSTOM HATCH PATTERN WITH THE BHATCH COMMAND
/cgi-bin/solution.pl?SID=36193

ACDBPOLYLINE DERIVED OBJECTS CANNOT SAVE PROXY GRAPHICS
/cgi-bin/solution.pl?SID=40154

WHY THE WIZARD GENERATED CODE OMITS _DECLSPEC(DLLIMPORT)
/cgi-bin/solution.pl?SID=40957

PAUSING FOR MULTIPLE USER INPUTS WITH ADS_COMMAND
/cgi-bin/solution.pl?SID=22162

SETTING DBMOD
/cgi-bin/solution.pl?SID=3615

CONVERTING CUSTOM ENTITY TO STANDARD AUTOCAD ENTITY AND VICE_VERSA
/cgi-bin/solution.pl?SID=13852

CHANGING ARX CLASS INFORMATION FOR OBJECTARX LOGO CERTIFIED APPLICATION
/cgi-bin/solution.pl?SID=26695

SETTING AN RASTER IMAGE'S SIZE AND SCALE
/cgi-bin/solution.pl?SID=35513

HOW TO EXPLODE ALL ENTITIES IN A SELECTION SET
/cgi-bin/solution.pl?SID=43833

HOW TO CREATE A MULTI-COLORED POLYLINE TYPE CUSTOM ENTITY
/cgi-bin/solution.pl?SID=44399

XREF API DOCUMENTATION
/cgi-bin/solution.pl?SID=42357

HOW TO USE SOME OF THE ACUI FEATURES
/cgi-bin/solution.pl?SID=41309

HANDOVERTO PROBLEM WHEN USING TRANSACTIONS
/cgi-bin/solution.pl?SID=26975

DERIVING A CUSTOM ENTITY FROM A BLOCK REFERENCE
/cgi-bin/solution.pl?SID=31523

REGISTERAPPNOTMDIAWARE PREVENTS TOOLBARS FROM SHOWING THEIR BUTTONS
/cgi-bin/solution.pl?SID=39233

REUSING CUSTOM OBJECT CLASS INTO ANOTHER ARX MODULE
/cgi-bin/solution.pl?SID=13619

HOW TO GENERATE PREVIEW FOR A DRAWING PROGRAMMETICALLY
/cgi-bin/solution.pl?SID=43257
  

(4) Check out DevCon presentations on the ADN WEB site
======================================================

"Actrix 2.0 API overview" by Cyrille Fauvel
"AutoCAD OEM 2000" by Kean Walmsley
"DevCon's Controls for AutoCAD" by Stefan Kraus
"Localization" by Cyrille Fauvel
"ObjectARX Masterclass-DeepCloning" by Cyrille Fauvel
"The ObjectARX 2000 Wizard" by Stefan Kraus
"Writting AEC OMF applications for AutoCAD Architectural Desktop" by Kean
Walmsley

http://adn.autodesk.com/techsupp/utilitiesconferences.htm

Other presentations will be soon available on tech ADN WEB site...

(5) ObjectARX Training Schedule
===============================

Check out the ADN Website for ObjectARX Classroom training scheduled around
the world:

http://www.autodesk.com/solution ... aining/schedule.htm

Upcoming ObjectARX training is:
US in November: Intro to ObjectARX, AutoCAD UI and Advanced ObjectARX
Europe in December: Intro to ObjectARX, AutoCAD UI

To register for classes or make suggestions please send an e-mail to:

adn-training-worldwide@autodesk.com.

-----------------------------------------------------------------------------
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

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

本版积分规则

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

GMT+8, 2024-5-11 15:40 , Processed in 0.365655 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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