PDA

View Full Version : Setting Layer Keystyle thru VBA



ccastelein
2008-09-24, 10:01 PM
I need some help.. ive been here a few times searching thru the forums on how to set your layer keystyle with out useing the GUI w/in Acad Arch (08)....

im really new to VBA but ive written a few things that mostly work (heh)

what i would like to do is to be able to change the Layer Keystyle with either VBA or if i have to Autolisp. I have searched the help files and this forum for a glimmer of hope.

the only thing i found was this bit of code:
set o_cLayerKeyStyles = o_doc.LayerKeyStyles

which tells me o_doc.layerkeystyles is the variable i need to change... i want to change it (when invoked) to another keystlye that will already be in the template....

any help out there? any help will be much appriciated...
ccastelein

RobertB
2008-09-24, 10:40 PM
There is an .arx application that makes this easy to do with Visual LISP.


(cond ((not (member "aeclmgrlisp.arx" (arx))) (arxload "AecLMgrLisp")))
(command "AecPurgeLayerStyles" "_y")
(AecImportLayerKeyingStyle <full filename layer key.dwg> <layer key name>)
(AecSetCurrentLayerKeying <layer key name>)

ccastelein
2008-09-25, 03:02 PM
RobertB,

Thank you very much, i hacked it into my code and it works with a few hiccups,
(what dont i write that doesnt behave weirdly!!)

but it gets the job done, and i thank you...

im not familiar with .arx stuff so i wouldnt have looked into this..

ccastelein