TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: TimSpangler on January 18, 2010, 11:11:10 AM
-
Can someone that is running 2004 tell me if this works:
(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.
-
Tim, do I need do anything more than paste this CODE to the command line for you?
-
No. That should be enough.
My guess is that it will return an error.
Thanks
-
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
-
copy/paste this line before, and run again.
(vl-load-com)
-
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
-
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.
-
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.
-
I don't think that this works:
(vla-getplotstyletablenames
ActiveLayout
)
)
But I would have thought that everything else would.....?
CAB, do you still have 04?
-
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:
(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.
-
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:
(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?
-
No service packs
-
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??
-
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")
-
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")