TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: TimSpangler on January 18, 2010, 11:11:10 AM

Title: AutoCAD 2004 Help
Post by: TimSpangler 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.
Title: Re: AutoCAD 2004 Help
Post by: mjfarrell 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?
Title: Re: AutoCAD 2004 Help
Post by: TimSpangler on January 18, 2010, 11:42:24 AM
No. That should be enough.

My guess is that it will return an error.

Thanks
Title: Re: AutoCAD 2004 Help
Post by: mjfarrell 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
Title: Re: AutoCAD 2004 Help
Post by: T.Willey on January 18, 2010, 12:04:51 PM
copy/paste this line before, and run again.

(vl-load-com)
Title: Re: AutoCAD 2004 Help
Post by: mjfarrell 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
Title: Re: AutoCAD 2004 Help
Post by: TimSpangler 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.
Title: Re: AutoCAD 2004 Help
Post by: T.Willey 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.
Title: Re: AutoCAD 2004 Help
Post by: TimSpangler 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?
Title: Re: AutoCAD 2004 Help
Post by: paulmcz 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.
Title: Re: AutoCAD 2004 Help
Post by: TimSpangler 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?
Title: Re: AutoCAD 2004 Help
Post by: paulmcz on January 18, 2010, 12:48:18 PM
No service packs
Title: Re: AutoCAD 2004 Help
Post by: TimSpangler 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??
Title: Re: AutoCAD 2004 Help
Post by: paulmcz 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")
Title: Re: AutoCAD 2004 Help
Post by: csgoh 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")