Jeff,
Thanks for your feedback. I will start with this but I hoping that Autodesk
will add this soon. You can access almost everything in
AutoCAD...(graphical objects, non-graphical objects, etc.) but not a simple
thing like style names in an STB file. Autodesk please add this ablility.
Thanks for everyones' responses.
"Jeff Mishler" wrote in message
news:406227e9_1@newsprd01...
> Well, not very elegant and I don't provide for any error handling but this
> should work for you. One thing that really needs to be added, but I don't
> recall how to do it, is to make sure to delete any existing log file for
the
> current drawing.
>
> HTH,
> Jeff
>
> (defun getstylelist (/ fname fH str stylenames)
> (setvar "qaflags" 6)
> (setvar "logfilemode" 1)
> (command "_.-plotstyle" "?" "")
> (setvar "logfilemode" 0)
> (setvar "qaflags" 0)
> (setq fName (findfile (getvar "logfilename")))
> (setq fH (open fname "r"))
> (repeat 4
> (read-line fH)
> )
> (while (and (setq str (read-line fH))
> (not (= str ""))
> )
> (setq stylenames (cons str stylenames))
> )
> (close fH)
> (reverse stylenames)
> )
>
>
> "Mr_Seiko" wrote in message
> news:40621681$1_1@newsprd01...
> > Good suggestion Dan, however not all of the styles listed in the STB
file
> > match the layer name. I have xrefs (externally generated) with layer
> names
> > that are not part of my layer standard so I need to filter out those
> layers
> > to a couple different style names which will not match the layer name.
> > Externally generated drawing which I xref into my drawings have
different
> > layer naming conventions so one xref may have a layer named A-BACK and
> > another xref may have a layer named A-WALL. Multiply that single layer
> > difference times 50 layers and it becomes a major amount of work. I
> would
> > like both of those layers to go to specified plot style of my choice. I
> am
> > using the (command "layer" "PStyle") function in my program but when it
> > comes to showing a list of available style names in the STB file I have
> not
> > found a way to extract that info. I have also not memorized every style
> > name in the STB file so I would like to extract the names and work with
a
> > list. Any other suggestions?
> >
> >
> > "Dan Allen" wrote in message
> > news:40620816$1_2@newsprd01...
> > > Why not just use (command "layer" "PStyle") and set the STB style you
> want
> > > for each layer? Maintain a list of either layer names or layer colors
> that
> > > gets mapped to a plotstyle.
> > >
> > > Alternately from www.acadx.com (which seems to be down today?)
> > >
> > >
> ;;; ----------------------------------------------------------------------
> > > ;;; from acadx Codemine cm_layers
> > > ;;; Set plot style for given object (graphic or otherwise, including
> > layers)
> > > ;;; NOTE: This can only apply named plot styles as overrides to any
> > defaults
> > > ;;; Can't find code for: vlxx-PlotStyle-Exists-p
> > > ;;; Plot styles aren't assigned unless they have already been set
once
> > > ;;; in the layer dialog
> > >
> ;;; ----------------------------------------------------------------------
> > > (defun vlxx-SetPlotStyle (obj strPstyle)
> > > (cond
> > > ( (and
> > > (= 0 (getvar "pstylemode")); using named plot styles?
> > > (member strPstyle (massoc 3 (dictsearch (namedobjdict)
> > > "ACAD_PLOTSTYLENAME")))
> > > (vlax-write-enabled-p obj)
> > > ( vlax-property-available-p obj "PlotStyleName")
> > > )
> > > (vla-put-PlotStyleName obj strPstyle)
> > > )
> > > )
> > > )
> > >
> > > Dan
> > >
> > > --
> > > ;;; For reply, change numbers to decimal
> > >
> > >
> > > "Mr_Seiko" wrote in message
> > > news:4061fe15$1_3@newsprd01...
> > > > Thanks for the feedback, however, no one answered the question. I
have
> > > been
> > > > using STB files since they came out. This is the only complaint I
> have
> > > with
> > > > STB technology. Let me explain a little more.
> > > >
> > > > I would like to convert old CTB based drawings to use STB
technology.
> I
> > > > know the whole story on how to convert these files so we don't need
to
> > go
> > > > into that. However, when you convert the drawings from CTB to STB,
> > > AutoCAD
> > > > automatically creates style names in the following format...Style_1,
> > > > Style_2, etc. Then I would like to change from using the STB file
> that
> > > > AutoCAD made to a different STB file that I have made which have
> > different
> > > > style names between the two. All of the STB files I have created
have
> > the
> > > > same style names between them so that is not the issue. The issue
is
> > > > changing a drawing from a STB file AutoCAD has automatically
assigned
> > > style
> > > > names to a STB file that I have created with different names and
then
> > > > updating your 300 layer drawing to use the other names. In my STB
> files
> > I
> > > > have created a style for each layer so I would like to write a
program
> > > that
> > > > automatically runs through the layer collection and assigns the
> matching
> > > > style name to the layer name. This also affects drawings that are
> > > > externally generated. If I want to QUICKLY change a drawings layers
> > from
> > > > STB file A to STB file B (with different style names) I would like
to
> be
> > > > able to accomplish that in some sort of way.
> > > >
> > > >
> > > > Actually it shouldn't matter what my use for this is but that
AutoCAD
> > > > exposes the style names in a STB file. There could be many
different
> > uses
> > > > for this and I am not about to list all of the advantages for
> > > > programmatically listing the style names of an STB file. Can it be
> done
> > > or
> > > > not? Don't respond with why, respond with how?
> > > >
> > > >
> > > >
> > > >
> > > > "Dave Alexander" wrote in message
> > > > news:405c4efc$1_1@newsprd01...
> > > > > It can be done. You just have to know what named plot style
applies
> to
> > > > what
> > > > > layer. You don't need to read the stb to do this because you made
> the
> > > damn
> > > > > thing in the first place and if it is someone else's stb, you
don't
> > know
> > > > > what plot style names are supposed to be applied to what layers
> > anyway.
> > > I
> > > > > sometimes think that people want to use VLISP/VBA just to show off
> > their
> > > > > programing skills.
> > > > >
> > > > > It may not be the way you want but I used stb's since they first
> came
> > > out
> > > > > and found that assigning plot styles to layers is no different
than
> > any
> > > > > other layer setting. We were old school, using layer colour to
> define
> > > pen
> > > > > width and never tried using layer lineweight settings.
> > > > > With a ctb, the layer colour is the key. With the stb, you can
> assign
> > > any
> > > > > named plot style to any layer regardless of layer colour. So
simply
> > > assign
> > > > > the named plot style to the layers the same way that you assign
any
> > > other
> > > > > setting. We used to use named plot styles that were colour
numbers,
> so
> > > any
> > > > > time we changed a layer colour, we also added the change plot
style
> to
> > > the
> > > > > same colour.
> > > > >
> > > > > The real key to the whole problem is once again, being able to
> compile
> > a
> > > > > list of layers to apply changes to. It all comes back down to
layer
> > > names.
> > > > >
> > > > > If you want to really get into stb's and layers, bring it on. I
may
> be
> > a
> > > > > little slow in replying, only really getting on the N.G. first
thing
> > in
> > > > the
> > > > > morning from home and only at noon hour from the office during the
> > week
> > > > but
> > > > > if you really want to discuss this, it will not matter the
intervals
> > > > between
> > > > > replies.
> > > > >
> > > > > Dave Alexander
> > > > > Keen Engineering Co. Ltd.
> > > > > www.keen.ca
> > > > >
> > > > >
> > > > > "Mr_Seiko" wrote in message
> > > > > news:405b8a1c$1_2@newsprd01...
> > > > > > I am using 2004. I am reposting this question as seen from
> > 'rthomas'
> > > on
> > > > > > 2/17/04. I have been to many different forums and have seen no
> > > solution
> > > > > to
> > > > > > accessing plot style names that are in a layer-dependent plot
> style
> > > > table
> > > > > > (STB) through VLISP/VBA. To not be able to automatically run
> > through
> > > > the
> > > > > > layer table and assign style name from a STB file is a HUGE
> missing
> > > > > > compenent of AutoCAD. I choose not to run through the 300
layers
> > and
> > > > set
> > > > > a
> > > > > > different style name to each layer. I can see why people are
> > hesitant
> > > > to
> > > > > > use the layer-dependent plot style technology. Any intelligent
> > > feedback
> > > > > > would be appreciated. Thanks.
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > >
> > > >
> > >
> > >
> >
> >
>
>