找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1150|回复: 0

AutoCAD Visual LISP Technical Newsletter - November 1999

[复制链接]

已领礼包: 145个

财富等级: 日进斗金

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

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

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

×
AutoCAD Visual LISP Technical Newsletter - November 1999  
This document is part of    Visual Lisp Newsletter Archive     



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

/Note: Have you missed a Newsletter issue? Visit our Newsletter archive at
the following URL:/

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

Dear Visual LISP developer,
  

Table of Contents
=================
(1) R14->R2000 LDATA ACCESSIBILITY
(2) Reactors in Visual LISP
(3) Debugging Visual LISP code
(4) New or updated solutions
  

(1) R14->R2000 LDATA ACCESSIBILITY
==================================

Into AutoCAD 2000, you may try loading an R14 drawing with ldata. But
unfortunately you'll be denied to access to R14's ldata while using
vlax-ldata-*** functions. This is due to a version incompatibility.
The workaround is provided at the following solution URL which contains
an attachment.

/cgi-bin/solution.pl?SID=45315

After you have downloaded the attachment and extracted it's files, move
the files ldataproxy.dll and ldata.arx into the same directory of your
machine's AutoCAD 2000 executable. You will see in the demonstrative
LISP file, checkforldata.lsp, the lines:

(if (null ldata-activate) (arxload "ldata.arx") )
(ldata-activate "EN81LIFTA")

The ldata.arx implements an external lisp function: ldata-activate. This
function takes as an argument the base filename (without extension) of the
compiled R14 Visual LISP ARX application. This will recover the proxy
information and allow the vlax-ldata-*** functions to work as expected.

While in R2000, if you run the function (chkforLdata) on the R14 drawing
included, you will observe a dump of the R14-generated ldata information.

Note: The R14 ldata will not withstand a round-trip of saves. If you save
the drawing in A2000 format, next time you open the dwg, you don't need to
execute the procedure. If you save the DWG back to R14 format, though, you
won't be able to access the LDATA info anymore in R14.
  
  

(2) Reactors in Visual LISP
===========================

Visual LISP not only makes program development easier and faster, it also
provides new functionality to AutoLISP applications. For example, you can
attach reactors to entities in the AutoCAD drawing window, allowing your
application to respond to user actions on these entities.

A reactor is an object you attach to AutoCAD drawing objects in order to have
AutoCAD notify your application when events you are interested in occur. For
example, if a user moves an entity that your application has attached a
reactor to, your application will receive notification that the entity has
moved. If you design it to do so, your application can react to this
notification with appropriate actions, such as moving other entities
associated with the one moved, or perhaps updating a text tag that records
revision information on the altered drawing feature.

A reactor communicates with your application by calling a function you have
associated with the reactor. Such a function is referred to as a callback
function. There isn't anything particularly unusual about reactor callback
functions, they are like other functions you write with Visual LISP. They
become callback functions when you attach them to reactor events.

There are many types of AutoCAD reactors. Each reactor type responds to one
or more AutoCAD events. The different types of reactors are grouped into
the following categories:

+ Database Reactors
  -----------------
  Database reactors notify your application when specific events occur to
  the drawing database, such as when an object has been added to the
  database.

+ Document Reactors
  -----------------
  Document reactors notify your application of a change to the current
  drawing document, such as opening a new drawing document, activating a
  different document window, and changing a document's lock status.

+ Editor Reactors
  ---------------
  Editor reactors notify you each time an AutoCAD command is invoked;
  a drawing opens, closes, or is saved;
  a DXF file is imported or exported;
  or a system variable changes value.

+ Linker Reactors
  ---------------
  Linker reactors notify your application every time an ARX application is
  loaded or unloaded.

+ Object Reactors
  ---------------
  Object reactors notify you each time a specific object is changed, copied,
  or deleted.

With the exception of Editor reactors, there is one type of reactor for each
reactor category.

Reactors may be transient or persistent. Transient reactors are lost when a
drawing closes; this is the default reactor mode. Persistent reactors are
saved with the drawing and exist when the drawing is next opened.
Use the vlr-pers function to make a reactor persistent. To remove persistence
from a reactor and make it transient, use vlr-pers-release. Each function
takes a Reactor object as its only argument.

HOW TO MONITOR AERIAL VIEW USAGE WITH VISUAL LISP
/cgi-bin/solution.pl?SID=7578

MAKING REACTORS PERSISTENT IN A DRAWING
/cgi-bin/solution.pl?SID=10858
  

(3) Debugging Visual LISP code
==============================

In AutoCAD 2000 functions are no longer lists. You will need to use the
Visual LISP IDE to locate the point of failure in your code. While it may
require some work learning about these IDE debug features, you'll find that
it's a much better environment to debug lisp code than that old command line
dump.

What you need to do to enable this facility (since the default is as you know
otherwise), will be to open the Visual LISP IDE at the beginning of your
AutoCAD session (type VLIDE at the command line), and go to the Debug Pulldown
menu in the IDE, and Select the 'Break On Error'. Then load your lisp code and
run it. When an error in your code occurs, you'll be put back into the Visual
LISP IDE, all you'll need to do to see which line caused the error is to
select the 'Last Break' option on the Debug Toolbar, or the
'Last Break Source' on the Debug pulldown.

There's many more powerful tools available to debug your lisp code using the
Visual LISP IDE, please refer to the Visual LISP Developer's Guide
See Chapter 3 -- Debugging Programs
for more information on using the IDE and it's debug features.
  

(4) New or updated solutions
============================

CREATING AND MANIPULATING XRECORDS USING AUTOLISP
/cgi-bin/solution.pl?SID=16132

(COMMAND) FUNCTION DOES NOT WORK WITH NEW AND OPEN
/cgi-bin/solution.pl?SID=29417

HOW TO IDENTIFY UNREFERENCED LAYERS IN LISP?
/cgi-bin/solution.pl?SID=30528

CREATION & MANIPULATION OF GROUPS USING AUTOLISP IN R14
/cgi-bin/solution.pl?SID=44942

USING THE SELECTION SET SELECT METHOD IN VISUAL LISP
/cgi-bin/solution.pl?SID=12298

USING A VB ACTIVEX DLL FROM VISUAL LISP OR VB(A)
/cgi-bin/solution.pl?SID=15992

CONSTUCTING Visual LISP LWPOLYLINE VIA ACTIVEX
/cgi-bin/solution.pl?SID=16152

EXTENSION DICTIONARY TO ASSOCIATE OBJECTS
/cgi-bin/solution.pl?SID=21716

HOW TO OPEN A NEW DRAWING IN VISUAL LISP
/cgi-bin/solution.pl?SID=30445

ATTRIBUTE DIALOG IS NOT DISPLAYING WHEN ATTDIA=1
/cgi-bin/solution.pl?SID=32444

HOW DO I REPLACE THE PLOTTER AND PLOTID SYSTEM VARIABLES
/cgi-bin/solution.pl?SID=41173

USING LISP TO FILTER SPECIFIC EXTENDED ENTITY DATA
/cgi-bin/solution.pl?SID=44434

WHAT IS THE OBJECT THAT VLAX-LDATA-XXX MANIPULATED?
/cgi-bin/solution.pl?SID=44984

USING LISP TO MODIFY THE ACAD SYSTEM VARIABLE
/cgi-bin/solution.pl?SID=45047

USING AN ARX ACTIVEX SERVER TO UPDATE THE BLOCK DESCRIPTION FROM LISP
/cgi-bin/solution.pl?SID=45070

ACAD.LSP & ACADDOC.LSP DO NOT LOAD IN DOCUMENT CREATED BY (COMMAND "NEW")
/cgi-bin/solution.pl?SID=45180

USING AN ARX ACTIVEX SERVER TO DETERMINE THE LOADED LISP FILES
/cgi-bin/solution.pl?SID=45186

WORKAROUND LOAD FAILURE ACAD.LSP/ACADDOC.LSP WHEN USING COMMAND NEW/OPEN
/cgi-bin/solution.pl?SID=45304
  

-----------------------------------------------------------------------------
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 21:11 , Processed in 0.360742 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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