Author Topic: MAP Projects object - Starting off with VLisp in MAP  (Read 3097 times)

0 Members and 1 Guest are viewing this topic.

sparky

  • Guest
MAP Projects object - Starting off with VLisp in MAP
« on: March 09, 2005, 04:21:32 AM »
Code: [Select]
(setq Amap (vla-getInterfaceObject (setq Acadobj (vlax-get-acad-object)) "AutoCADMap.Application")
      MapProjsColl (vla-get-Projects Amap)
      )


That's me trying to get a reference to the Projects Collection in MAP.  Unfortuneatly I get an error at the second setq assignment "Failure: no function defintion: VLA-GET-PROJECTS". :oops:

Have I missed something about the structure of the MAP add on Object to 2K2?  The VLisp editor doesn't highlight the method/property call to the Amap obj (which does actually produce a valid AcadMap object), which I guessed meant the setq wouldn't work!?  :?

The Inquiry window on the Amap obj lists the four sub collections/Properties, but the normal vla-get call doean't retrieve the refernece!! :x

Jeff_M

  • King Gator
  • Posts: 4094
  • C3D user & customizer
MAP Projects object - Starting off with VLisp in MAP
« Reply #1 on: March 09, 2005, 01:52:55 PM »
The Map library is not included in the standard types. This works:
(vlax-get Amap 'Projects)
You could also do this:
Code: [Select]

(vlax-import-type-library
   :tlb-filename   "AMVbApi.tlb"
   :methods-prefix     "map-"
   :properties-prefix  "map-"
   :constants-prefix   "vbmap-"
  ) ;

(setq MapProjsColl (map-get-Projects Amap))

sparky

  • Guest
Type-libraries...and stuff!
« Reply #2 on: March 10, 2005, 03:14:09 AM »
Thanks...gave your tips a tryout and of course they work.  There were alot of map- methods and properties listed in the Apropo Window, so all was successful.  I can of course just invoke a Amap method using the vlax-invoke-method funtion, No?

At least I can spend some time now taking a look at the Map objects on offer and let them digest over a period.

Thanks for the lesson! :D