Author Topic: Aecc.Application Version dependent?  (Read 5974 times)

0 Members and 1 Guest are viewing this topic.

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Aecc.Application Version dependent?
« on: August 26, 2004, 01:13:17 PM »
This code gets the Aecc.Application so I can access the Land databases and works fine with LDD3 (so long as the Land has initialized)
Code: [Select]
(setq acadObj  (vlax-get-acad-object)
aecApp  (vla-getinterfaceobject acadObj "Aecc.Application")

Does the reference need to be revised for newer relaeses, such as "Aecc.Application.4" like the acad object does when referencing from outside the drawing environment? If so, what are they for each version?

Thanks

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Aecc.Application Version dependent?
« Reply #1 on: August 26, 2004, 01:53:08 PM »
This is what "Help" says from 2005 Jeff.
Quote

An instance of the Autodesk Land Desktop application.
VBA object name:
 AeccApplication
 
Create using:
 For VB:
GetObject("Acad.Application") or
reateObject("Acad.Application") then
etInterfaceObject("Aecc.Application")

For AutoCAD VBA:
not applicable. The application is always available.
 
Access via:
 Application Property
 


HTH
TheSwamp.org  (serving the CAD community since 2003)

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Aecc.Application Version dependent?
« Reply #2 on: August 26, 2004, 02:03:20 PM »
Hmm, Thanks Mark. That is exactly the same as the LDD3 "Help", including the omitted characters :)

So, THAT isn't the problem in my code that works fine on my LDD3 and others have reported using it on 2004, but a new user has run into problems in 2005.....
Back to searching....

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Aecc.Application Version dependent?
« Reply #3 on: August 26, 2004, 02:10:07 PM »
One other thought, Mark.
Does 2005 still place dwgname.dfm files in the project drawing folder? I had used the dfm file to retrieve the layer, precision and station type defaults, since I hadn't yet learned how to acces these via ActiveX. I'm thinking that if that file no longer exists (or doesn't store the same data) my program will bomb.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Aecc.Application Version dependent?
« Reply #4 on: August 26, 2004, 02:29:58 PM »
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Aecc.Application Version dependent?
« Reply #5 on: August 26, 2004, 02:53:30 PM »
>since I hadn't yet learned how to acces these via ActiveX.

I just did. :D

try this.
Code: [Select]

(defun AeccPrefObj (/ AeccApp AeccActiveDoc AeccPrefs)
  (vl-load-com)

  (setq AeccApp
(vl-catch-all-apply
  'vla-getinterfaceobject
  (list (vlax-get-acad-object) "Aecc.Application")
  )
)
  (cond
((vl-catch-all-error-p AeccApp)
(princ (vl-catch-all-error-message AeccApp))
nil
)
((not (vl-catch-all-error-p trap))
(setq AeccActiveDoc (vlax-get-property AeccApp 'ActiveDocument)
  AeccPrefs (vlax-get-property AeccActiveDoc 'Preferences)
  )
)
)

  )
TheSwamp.org  (serving the CAD community since 2003)

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Aecc.Application Version dependent?
« Reply #6 on: August 26, 2004, 05:14:35 PM »
OK, thanks Mark. It looks like it is still pretty much the same.

I wonder if the file is NOT stored with the drawing when the drawing/project is not stored per the Land default.......If (findfile) doesn't return a value it would break the old code, too.......

I've modified my routine to use the values returned by the AeccPreferences object in place of directly reading that file. I haven't been able to break it yet......<crossing fingers>

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Aecc.Application Version dependent?
« Reply #7 on: August 26, 2004, 05:22:34 PM »
Quote from: Mark Thomas
>since I hadn't yet learned how to acces these via ActiveX.

I just did. :D

try this.

Yeah, I originally wrote my routine about a year ago. I've since learned a TON on accessing the preferences data. Here's a snip of what I was doing vs what I am now doing. 8)
Code: [Select]

  (setq acadObj  (vlax-get-acad-object)
aecApp  (vla-getinterfaceobject acadObj "Aecc.Application")
aecProj (vlax-get aecApp "ActiveProject")
aecAligns (vlax-get aecProj "Alignments")
aecAlign (vlax-get aecAligns "CurrentAlignment")
)
  (if (member "aeccapp.arx" (arx))
; import the Land type library, a described by "sinc" at TheSwamp
        ; I believe his real name is Richard Sinclair
; this should only be done once, so first check to see if a
; constant defined by the type library already exists...
(if (= nil vll-kCurve)
 (vlax-import-type-library
   :tlb-filename   "landauto.tlb"
   :methods-prefix     "vll-"
   :properties-prefix  "vll-"
   :constants-prefix   "vll-"
  ) ;_ vlax-import-type-library
) ;_ if
  )
  (setq PrefProj (vll-get-preferences aecProj))
  (setq PrefAlign (vla-get-alignment PrefProj))
;;The following commented out code is obsolete, as it used the dwg.dfm file
;;;(setq  dname (vla-get-name *doc*)
;;;    dname (substr dname 1 (- (strlen dname) 4))
;;;    dfmFile (open (findfile (strcat dname ".dfm")) "r")
;;;    )
;;;      (while (not (= "[ADAlignValues]" (setq dfmLine (read-line dfmFile))))
;;; t
;;; )
;;;      (while (not (= "[DELots]" (setq dfmLine (read-line dfmFile))))
;;; (setq staVars (cons (str2list dfmLine "=") stavars))
;;; )
;;;      (setq staVars (reverse staVars))
;;;      (close dfmFile)
;;;      (if (= (cadr (assoc "prefix" staVars)) "*")
;;; (setq layr (strcat alignName (cadr (assoc "staptslay" staVars))))
;;; (setq layr (cadr (assoc "staptslay" staVars)))
;;; )
;;;      (setq preTxt (strcat (cadr (assoc "pi" staVars)) " = ")
;;;    staOff (atof (cadr (assoc "staoff" staVars))))
      (setq layr (vll-getstring PrefAlign vll-kStationPntLayer)
   preTxt (vll-getstring PrefAlign vll-kLabelPt)
   staoff (vll-getdouble Prefalign vll-kStationLabelOffset)
   )
      (if (wcmatch (vll-getstring PrefAlign vll-kAlignLayerPrefix) "`**")
(setq layr (strcat alignName layr))
)

sinc

  • Guest
Aecc.Application Version dependent?
« Reply #8 on: August 26, 2004, 10:19:15 PM »
Quote from: Jeff_M

   ; import the Land type library, a described by "sinc" at TheSwamp
        ; I believe his real name is Richard Sinclair

I've gotten mail addressed to Richard Sinclair before... :)

My name is actually Richard Sincovec....

Jeff_M

  • King Gator
  • Posts: 4096
  • C3D user & customizer
Aecc.Application Version dependent?
« Reply #9 on: August 27, 2004, 03:54:13 AM »
Quote from: sinc

My name is actually Richard Sincovec....
Duly noted and modified in my code snip.

My apologies :oops: and thanks again for that little snippet.   :D