<<  Best Cross Platform Development Best Practices  >>
ObjectARX® Best Practices
ObjectARX® Best Practices
Loading Applications - Manually
Loading Applications - Manually
Loading Applications – on Startup
Loading Applications – on Startup
Loading Applications – on Demand
Loading Applications – on Demand
Autodesk, AutoCAD* [*if/when mentioned in the pertinent material,
Autodesk, AutoCAD* [*if/when mentioned in the pertinent material,
Autodesk, AutoCAD* [*if/when mentioned in the pertinent material,
Autodesk, AutoCAD* [*if/when mentioned in the pertinent material,
Картинки из презентации «ObjectARX Best Practices» к уроку экономики на тему «Компании»

Автор: . Чтобы познакомиться с картинкой полного размера, нажмите на её эскиз. Чтобы можно было использовать все картинки для урока экономики, скачайте бесплатно презентацию «ObjectARX Best Practices.pptx» со всеми картинками в zip-архиве размером 4439 КБ.

ObjectARX Best Practices

содержание презентации «ObjectARX Best Practices.pptx»
Сл Текст Сл Текст
1ObjectARX® Best Practices. Davis 21symbols to avoid name clashes
Augustine Autodesk, Inc.
2Class Summary. We will cover concepts . Create commands via acedAddCommand()
and practices important for ObjectARX Invoke commands via acedCommand() and
developers. Key areas include general acedCmd() These APIs use a “co-routine”
application organization, development stack mechanism on Windows #define
tools, localization, user interface and ACRX_CMD_NONEWSTACK 0x00010000 // For
logic separation, error handling, internal use only Sending commands from
portability, performance, extensibility, modeless controls sendStringToExecute() is
installation, maintenance, testing, and asynchronous.
debugging. 22Commands – and Fibers. Fibers are used
3What we’ll Discuss. Not a primer – to support simultaneous stacks Also known
more of a sampling of best practices See as coroutines Similar to multi-threading,
developer support and training for but fiber switches are controlled Not
comprehensive how-to’s My background is in available on Mac. Microsoft has warned
AutoCAD internals, database and dwg they’re going away too Issues with managed
frameworks ObjectARX involves native C++, environments Use new acedCommandS() which
not .NET See other classes for .NET best bundles args with command.
practices Upcoming Release features still 23Functions. Use acedDefun() and
under NDA Refer to Monday’s ADN acedRegFunc() to declare functions
conference. callable by Lisp Obtain resbuf list arg
4Some Related Classes. AutoCAD® 2012 via acedGetArgs() Invoke lisp functions
Application Autoloader Technology Revealed from C++ by calling acedInvoke() Use a
Fenton Webb: CP2080 – Tues 1:15pm Moving registered developer symbol (RDS) on
from Desktop to Cloud Albert Szilvasy: function names 4-letter prefix. Free and
CP5163 – Wed 8:15am Porting ObjectARX® easy to register.
Applications and User Interfaces to 24Programming Practices - Strings. Use
AutoCAD® for Mac® Asheem Mamoowala: CP6280 String Classes AcString, CString or
- Wed 3pm How Do You Do? And Undo? And std::wstring CString may not be portable
Redo? And Undo from Redo? Bill Adkison: to Mac Use Unicode wchar_t, not ansi char
CP4284 – Thur 8:15am Parallel Programming -define UNICODE=1 in project
in an AutoCAD® Application Gopinath Taget: (CharacterSet=Unicode) When persisting to
CP2526 – Thur 1:15pm Improving Your a file, consider UTF-8 More compact Easy
ObjectARX® C++ Code Mike Dickason: CP5177 to convert from utf-16 or utf-32.
– Thur 3:15pm. 25Programming Practices – XData and
5ObjectARX vs Other Technologies. .NET XRecords. XData is older, simpler Less
“Managed” languages. C# Safer, more overhead Limited to 16k or 32k max size
powerful and more friendly WPF U/I Easier to deal with in Lisp Resbuf list
framework Not available on Mac There is a processing can get messy XRecords are
third party technology called Mono Does AcDbObjects Usually owned by another
not support custom classes (enablers) VBA Object’s Extension Dictionary Easier to
Not well supported in 64-bit Not available locate than xdata because of dictionary
on Mac Will be removed soon. key Unlimited size Resbufs can be awkward
6ObjectARX vs Other Technologies. here too.
Visual LISP Oldest extension technology. 26Programming Practices - Misc. Be aware
Easy to write and deploy U/I options of dwg’s version GUID Uniquely identifies
limited – DCL DCL also available to C++, a dwg file – regenerated on every save
is platform independent Can access COM Useful for associating dwgs to external
model Nice GUI Scripts Limited to what you databases Object handles normally never
can send on the command line Use CUI to change Except during wblock * Use comments
override and customize commands. and asserts liberally It sounds obvious,
7Tools and SDKs. Microsoft Visual but is usually not done.
Studio 2010 (SP1) Install both 32-bit 27Portability Tips. Do not use long type
(x86) and 64-bit (x64) support (not IA64) Is 64 bits on Mac/gnu C++ Use IntPtr or
ObjectARX SDK for Windows Can do all other polymorphic types for variables that
development on 64-bit Windows and cross hold pointer and int vals Many Win32 APIs
compile But can’t run 32-bit AutoCAD on emulated in Mac ObjectARX Isolate U/I code
64-bit OS Mac XCode IDE ObjectARX SDK for into separate module from Dialogs and
the Mac 64-bit only. fancy U/I controls difficult to share Can
8Big Split – Application Stack. ARX use DCL as a crude portable U/I framework.
apps. ARX apps. AutoCAD Windows. AutoCAD 28Error Handling – Out of Memory. More
for Server/Console. AutoCAD Mac. AutoCAD likely in 32-bit environment Encourage
Core Engine. CRX apps. AcCore.dll. DBX customers to migrate to 64-bits Treated by
apps. AcDbXX.dll. AutoCAD as a fatal error Both AutoCAD and
9Project Types - ARX. ARX, CRX and DBX Windows may warn before it happens No
Modules All are essentially DLLs Must point in checking for malloc or new
match 32 or 64 bit-ness of main EXE ARX returning NULL in your code Apps can
implements Graphical U/I Dialogs, Tool temporarily override out-of-memory
palettes, Requires AutoCAD or a vertical handling Use C++ set_new_handler() to
(e.g. ADT) as the host app Can be done in intercept the event Check for NULL
.NET also Currently often contains the CRX returned by new or malloc in that case
component Often platform (Mac or Windows) Restore the previous new_handler().
specific Should be an MFC extension on 29Error Handling – Opening and Closing
Windows. Objects. acdbOpen and upgradeOpen may fail
10Project Types – CRX. CRX implements Check results for eOk, handle failure
business logic Can run on CoreDll-based gracefully Use SmartPointer classes for
Host Apps Platform independent (Mac, more reliable open/close dbobjptr.h,
Windows, WS) Should not use MFC May be dbobjptr2.h – ReadableAcDbObject,
driven by ARX App Through command strings WriteableAcDbObject Also help with objects
or C++ function calls. on locked layers Don’t open objects for
11Project Types – DBX. DBX (enabler) write unless you need to Don’t forget to
implements a custom class More complicated close objects May lead to future failures
to develop Proxy and versioning issues Can to open Smart pointers can help with this
load under Real-Dwg based Apps Usually do too.
not define commands or functions Cannot be 30Error Handling – CERs. Fatal Error
done in .NET Should not use MFC Consider Causes Access violations Internal fatal
using Overrules instead. errors Out of memory Other unhandled
12Windows ARX Using MFC. ARX can be an exceptions Customer Error Reports Register
MFC extension DLL Must link to dynamic MFC your app so that Autodesk can contact you
lib, not static lib MFC is a “mature” about CERs Your customers may email you
framework Use AcUi and AdUi classes to the CER zip files for your inspection
implement dialogs, toolbars, etc Work with AutoCAD symbol server at
AutoCAD windows better than standard MFC
classes Provide functionality not 31Performance Tips – Dwg Files. Opening
available in standard MFC Tabbed dialogs, dwg files _SH_DENYWR is lazy, but locks
interaction with AutoCAD windows, out writers _SH_DENYNO reads in whole
TextTips, DrawTips, etc, etc. file, allows other access kTryForReadShare
13Localization and Resources. Keep attempts to do _SH_DENYWR, falls back to
strings, bitmaps etc in resource dlls _SH_DENYNO For batch processing, consider
Translate the resource dll to different separate processes per dwg Isolates the
locales Visual Stdio sets up projects this operations on each dwg No accumulated
way automatically MFC often uses a default leaks Allows parallelism Requires
resource module CString::LoadString(UInt communication between main process and
nId); AfxSetResourceHandle(), slave processes Use shared memory, pipes,
AfxGetResourceHandle() COM, or messages to communicate.
CAcModuleResourceOverride class switches 32Performance Tips – Undo. Consider
the default Dynamic locale switching On partial undo recording for custom objects
Mac, resources are part of bundles. By default, entire object is filed out to
14Heap Mismatch Issues. Production undo filer Consider disabling and
AutoCAD uses “dll” C Runtime Lib (msvcrt) re-enabling undo around some operations
Other options are static libs (libc, E.g., if you are going to open a dwg, make
libcmt) And debug libs (libcd, libcmtd, some changes, save it and quit Undo file
msvcrtd) And other MSVC versions (VS 2008) currently has a 2G logical limit File can
Some ARX APIs expect client to use same be cleared by disabling and reenabling
heap as acad. E.g., any API taking a undo.
non-const AcArray argument The array may 33Performance Tips – Misc. Don’t worry
be grown (i.e. reallocated) by acad. about micro coding tricks Compiler is very
15Visual Studio. Debug build should good at optimizing. Concentrate on code
disable optimization But still should use readability E.g.: *dest++ = *src++;
release clib and mfc Enable PDB files for Pre-allocate array space to avoid slow
both release and debug Increase warning buffer growth
level to 3, make warnings fatal /W3 /WX AcArray<T>::setLogicalLength() or
Use .props files to standardize projects. setPhysicalLength()
<ImportGroup std::vector<T>::resize() Consider
Label="PropertySheets"> linking with /delayload switch Will leave
<Import dlls out of memory until they are first
Project=“C:\MyProj\MyShared.props" called.
/> </ImportGroup> 34Custom Objects - Filing. In
<ItemDefinitionGroup. dwgOutFields and dwgInFields, first file a
16Project Types - Mac. // Objective C version integer Will come in handy during
int n = [myObj getInt:nArg]; // C++ int n future versions Use filerType() to decide
= myObj->getInt(nArg); Use .dylib for whether all data needs to be filed E.g.:
DBX Use .bundle/.framework type for ARX kPurgeFiler, kIdXlate filer only need to
Application framework is called COCOA Can see ObjectIds Consider overriding
use C++ or Objective C C++ uses gnu cloneMeForDragging() to return false
compiler Objective C very different from Avoids cloning during drag - good for very
C++. large entities Also override dragStatus().
17Installing ARX Applications. Recommend All transformBy() calls up to dragStatus()
using AutoLoader Copy or install files to are drag updates.
one of two special folders 35Links.
C:\Users\[login]\AppData\Roaming\Autodesk\ (whitepapers, knowledge base, etc)
pplicationPlugins\MyApp.bundle C:\Program
Files\Autodesk\ApplicationPlugins\MyApp.bu on/ (product user guides) Arxdev.chm
dle Create a master XML file to describe (ObjectARX Developers Guide)
the deployment Works with the app store - (articles
(Exchange) Can use Microsoft MSI Well on various products and technologies)
tested, integrated with Windows Can also
do xcopy or unzip or use InstallShield or rough_the_interface/ (.NET oriented)
whatever. (simple
18Loading Applications - Manually. arx arx tutorial).
load From AutoCAD command line (arxload 36Thank you! Q & A.
“myapp”) Lisp function also callable from 37Autodesk, AutoCAD* [*if/when mentioned
lisp scripts AppLoad dialog Drag and drop in the pertinent material, followed by an
From explorer to AutoCAD window. alphabetical list of all other trademarks
19Loading Applications – on Startup. mentioned in the material] are registered
Acad.rx text file Registry: trademarks or trademarks of Autodesk,
Dialogs\Appload\Startup Set up by AppLoad Inc., and/or its subsidiaries and/or
Acad.lsp AcadDoc.lsp – invoked at dwg open affiliates in the USA and/or other
Windows command line arg acad /ld countries. All other brand names, product
MyApp.arx. names, or trademarks belong to their
20Loading Applications – on Demand. ARX respective holders. Autodesk reserves the
apps via registered command right to alter product and services
Applications\MyApp DBX enablers via dwg offerings, and specifications and pricing
open Dwg contains custom object or entity at any time without notice, and is not
App name attached to class via responsible for typographical or graphical
newAcRxClass(). errors that may appear in this document. ©
21Commands. Register your developer 2011 Autodesk, Inc. All rights reserved.
ObjectARX Best Practices.pptx
cсылка на страницу

ObjectARX Best Practices

другие презентации на тему «ObjectARX Best Practices»

«Производство гранул» - Количество сырья. Хранение готовых гранул. Что дают гранулы потребителям? Частный рынок. Дополнительные факторы рентабельности. Одна из самых молодых отраслей Российской экономики Самая быстрорастущая отрасль! Постоянные затраты. Сравнение ценовых характеристик энергоносителей. Дополнительные рекомендации.

«Компания Индиго» - Херсон. Харьков. Донецк. ОДО “Страховая компания “Индиго” Центральный офис: ул. Динамика финансовых показателей. Днепропетровск. Итоги конкурса объявлены в феврале 2010г. Перестрахование. Запорожье. Polish Re (Польша). Предоставляет качественную перестраховочную защиту принятых на страхование рисков.

«Компания Связьинвест» - Структура акционерного капитала (голосующие акции). Совершенствование системы стратегического управления. Приватизация компаний связи. Внедрение соответствующей инфраструктуры сети для поддержки бизнеса. Оао «мгтс». Управление изменениями. Эффективная финансово-экономическая служба. Разработка ИТ инфраструктуры.

«Джобс Apple» - Имя при рождении: англ. Apple II. Стив Джобс. Стивен Пол Джобс— американский предприниматель и изобретатель. Все о Стиве в краце. Создание ПК Apple II.

«Сотовая связь» - Развитие сотовой связи. Карта зоны предоставления услуг. Рынок услуг сотовой связи в Поволжском регионе. Доля холдинга «Связьинвест» на рынке сотовой связи. Количество абонентов операторов сотовой связи, входящих в холдинг «Связьинвест». Динамика количества абонентов сотовых компаний стандарта GSM, входящих в Холдинг ОАО «Связьинвест».

«Изделия из пластмассы» - На каждое изделие наносят товарный знак предприятия – изготовителя. Маркировка должна быть четкой, ясной и легко читаемой. Методы испытания. Упаковка изделий из пластмасс. Маркировка изделий из пластмасс. Требования к качеству изделий из пластических масс. Ассортимент и качество изделий из пластмасс.


40 презентаций о компаниях


125 тем