Author Topic: AutoCAD 2004 Help  (Read 3285 times)

0 Members and 1 Guest are viewing this topic.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
AutoCAD 2004 Help
« on: January 18, 2010, 11:11:10 AM »
Can someone that is running 2004 tell me if this works:

Code: [Select]
(setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
(setq ActiveLayout (vla-get-ActiveLayout ActiveDoc))
(setq PlotStyleTables
  (vlax-safearray->list
   (vlax-variant-value
    (vla-getplotstyletablenames
     ActiveLayout
    )
   )
  )
 )

Any help would be appreciated.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: AutoCAD 2004 Help
« Reply #1 on: January 18, 2010, 11:38:27 AM »
Tim, do I need do anything more than paste this CODE to the command line for you?
Be your Best


Michael Farrell
http://primeservicesglobal.com/

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: AutoCAD 2004 Help
« Reply #2 on: January 18, 2010, 11:42:24 AM »
No. That should be enough.

My guess is that it will return an error.

Thanks
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: AutoCAD 2004 Help
« Reply #3 on: January 18, 2010, 11:47:28 AM »
No. That should be enough.

My guess is that it will return an error.

Thanks


You guess correctly sir,


Now how much do I weigh?



Command: (setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
; error: no function definition: VLAX-GET-ACAD-OBJECT

Command: (setq ActiveLayout (vla-get-ActiveLayout ActiveDoc))
; error: no function definition: VLA-GET-ACTIVELAYOUT

Command: (setq PlotStyleTables
(_>   (vlax-safearray->list
((_>    (vlax-variant-value
(((_>     (vla-getplotstyletablenames
((((_>      ActiveLayout
((((_>     )
(((_>    )
((_>   )
(_>  )
; error: no function definition: VLA-GETPLOTSTYLETABLENAMES
Be your Best


Michael Farrell
http://primeservicesglobal.com/

T.Willey

  • Needs a day job
  • Posts: 5251
Re: AutoCAD 2004 Help
« Reply #4 on: January 18, 2010, 12:04:51 PM »
copy/paste this line before, and run again.

(vl-load-com)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: AutoCAD 2004 Help
« Reply #5 on: January 18, 2010, 12:14:28 PM »
copy/paste this line before, and run again.

(vl-load-com)


Command: (vl-load-com)

Command: (setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
; error: no function definition: VLAX-GET-ACAD-OBJECT

Command: (setq ActiveLayout (vla-get-ActiveLayout ActiveDoc))
; error: no function definition: VLA-GET-ACTIVELAYOUT

Command: (setq PlotStyleTables
(_>   (vlax-safearray->list
((_>    (vlax-variant-value
(((_>     (vla-getplotstyletablenames
((((_>      ActiveLayout
((((_>     )
(((_>    )
((_>   )
(_>  )
; error: no function definition: VLA-GETPLOTSTYLETABLENAMES
Be your Best


Michael Farrell
http://primeservicesglobal.com/

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: AutoCAD 2004 Help
« Reply #6 on: January 18, 2010, 12:18:11 PM »
copy/paste this line before, and run again.

(vl-load-com)


Command: (vl-load-com)

Command: (setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
; error: no function definition: VLAX-GET-ACAD-OBJECT


That's odd.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

T.Willey

  • Needs a day job
  • Posts: 5251
Re: AutoCAD 2004 Help
« Reply #7 on: January 18, 2010, 12:26:11 PM »
copy/paste this line before, and run again.

(vl-load-com)


Command: (vl-load-com)

Command: (setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
; error: no function definition: VLAX-GET-ACAD-OBJECT


That's odd.

Yea.  I had '04 for awhile, and I coded with ActiveX, so I know those few calls will work, but the latter part was what I wasn't sure of.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: AutoCAD 2004 Help
« Reply #8 on: January 18, 2010, 12:39:17 PM »
I don't think that this works:

Code: [Select]
(vla-getplotstyletablenames
      ActiveLayout
  )
)

But I would have thought that everything else would.....?

CAB,  do you still have 04?
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

paulmcz

  • Bull Frog
  • Posts: 202
Re: AutoCAD 2004 Help
« Reply #9 on: January 18, 2010, 12:44:13 PM »
This is what I get in 2004:
("acad.ctb" "DWF Virtual Pens.ctb" "Fill Patterns.ctb" "Grayscale.ctb" "monochrome.ctb" "Screening 100%.ctb" "Screening 25%.ctb" "Screening 50%.ctb" "Screening 75%.ctb")

Can someone that is running 2004 tell me if this works:

Code: [Select]
(setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
(setq ActiveLayout (vla-get-ActiveLayout ActiveDoc))
(setq PlotStyleTables
  (vlax-safearray->list
   (vlax-variant-value
    (vla-getplotstyletablenames
     ActiveLayout
    )
   )
  )
 )

Any help would be appreciated.

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: AutoCAD 2004 Help
« Reply #10 on: January 18, 2010, 12:47:02 PM »
This is what I get in 2004:
("acad.ctb" "DWF Virtual Pens.ctb" "Fill Patterns.ctb" "Grayscale.ctb" "monochrome.ctb" "Screening 100%.ctb" "Screening 25%.ctb" "Screening 50%.ctb" "Screening 75%.ctb")

Can someone that is running 2004 tell me if this works:

Code: [Select]
(setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
(setq ActiveLayout (vla-get-ActiveLayout ActiveDoc))
(setq PlotStyleTables
  (vlax-safearray->list
   (vlax-variant-value
    (vla-getplotstyletablenames
     ActiveLayout
    )
   )
  )
 )

Any help would be appreciated.

That's what I hope to see.  Do you have any service packs installed?
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

paulmcz

  • Bull Frog
  • Posts: 202
Re: AutoCAD 2004 Help
« Reply #11 on: January 18, 2010, 12:48:18 PM »
No service packs

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: AutoCAD 2004 Help
« Reply #12 on: January 18, 2010, 12:58:03 PM »
If I am getting this error:

; error: ActiveX Server returned an error: Invalid index

That would tell me that it has something to do with the array??
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

paulmcz

  • Bull Frog
  • Posts: 202
Re: AutoCAD 2004 Help
« Reply #13 on: January 18, 2010, 01:00:26 PM »
Actually I get this as a return running your code from 'vlide' :

#<VLA-OBJECT IAcadDocument 0116b820>
#<VLA-OBJECT IAcadLayout 02dbcf64>
("acad.ctb" "DWF Virtual Pens.ctb" "Fill Patterns.ctb" "Grayscale.ctb" "monochrome.ctb" "Screening 100%.ctb" "Screening 25%.ctb" "Screening 50%.ctb" "Screening 75%.ctb")

csgoh

  • Newt
  • Posts: 176
Re: AutoCAD 2004 Help
« Reply #14 on: January 21, 2010, 08:48:51 AM »
i got no errors. still using map 2004.

Command: (setq ActiveDoc (vla-get-activedocument (vlax-get-acad-object)))
#<VLA-OBJECT IAcadDocument 01254f90>

Command: (setq ActiveLayout (vla-get-ActiveLayout ActiveDoc))
#<VLA-OBJECT IAcadLayout 04b66ee4>

Command: (setq PlotStyleTables
(_>   (vlax-safearray->list
((_>    (vlax-variant-value
(((_>     (vla-getplotstyletablenames
((((_>      ActiveLayout
((((_>     )
(((_>    )
((_>   )
(_>  )
("acad.ctb" "C-PLAN.ctb" "CANON.ctb" "COLOOR.ctb" "DBKL.ctb" "DRAFT-BLACK.ctb"
"DRAFT.ctb" "DRAFT2.ctb" "DWF Virtual Pens.ctb" "Fill Patterns.ctb"
"Grayscale.ctb" "monochrome.ctb" "MPKJ.ctb" "QT.ctb" "Screening 100%.ctb"
"Screening 25%.ctb" "Screening 50%.ctb" "Screening 75%.ctb" "STRATAPLAN.ctb"
"WENDY.ctb")