Author Topic: Vlisp to use AcDbHostApplicationServices  (Read 5850 times)

0 Members and 1 Guest are viewing this topic.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Vlisp to use AcDbHostApplicationServices
« Reply #15 on: November 26, 2012, 01:46:12 PM »
At this time I'm relying on an extremely simple .net LispFunction to set the workingdatabase to the supplied dbx database being processed before changing attributes values, and then calling the LispFunction again after attribute modification is complete, to set the workingdatabase back to the original database.
What you could do is have a separate LispFunction to "open" another DB. This would save the other DB into a private field (set as a List) then return the index of that object in the list.

Your normal LispFunction could then have an extra (perhaps optional) argument which accepts this idx so it could perform operations on the non-current DB.

Unfortunately ALisp was never good at working with more than one DWG file at a time. The ObjectDBX idea is the only feasible way of going about it without scripting and/or other programming SDKs. This is because ALisp runs inside the document's namespace - without some external help it doesn't even know that there is anything else than the current DWG. It's like it's been sandboxed. But actually it's because this aspect was never updated since the DOS days when only one DWG could be opened at any one time.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

togores

  • Guest
Re: Vlisp to use AcDbHostApplicationServices
« Reply #16 on: November 27, 2012, 05:10:13 AM »
Haven't read this (saw it on linkedin today) but ya'll may be interested.
Hi, that's my book. You can get an idea of what it is about by watching my class in AU2012 Virtual http://au.autodesk.com/?nd=au_player#1%0:3202, starting today (November 27).
Its title is "LISP your MESH to Shape!". The book includes an introduction to LISP programming techniques, The classic AutoLISP API and the Visual LISP enhancements.
It is centered mainly in the creation and modification of graphic and non-graphic objects, with an special emphasis on 3D, 216 pages to explain things like Transformation matrices, Coordinate Systems, Viewpoint and Visual Style, Visual LISP’s VLAX-CURVE Extensions, SPLINES, Legacy Polygon and Polyface Meshes, Solid Modeling and Editing 3DSolids, Subdivision surfaces (MESH), and Procedural and NURBS Surfaces. It also includes a Chapter on OpenDCL.
This is my first book in english about this subject, coming after two books in spanish (2003 and 2012). You can find more details in my website http://www.togores.net/
« Last Edit: November 28, 2012, 06:28:04 AM by togores »