Setting layer Plotstyle in VBA
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Setting layer Plotstyle in VBA

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
Kevin Schafer
Guest





Posted: Tue Dec 07, 2004 10:28 pm    Post subject: Setting layer Plotstyle in VBA Reply with quote

I'm trying to create a VBA routine which will create layers from a comma
delimited file. The file will contain all the layer setting including Name,
Freeze/thaw, On/off, Color, Linetype, Lineweight, Plotstyle. I have been
able to get the routine to create the layers with everything correct,
however I can't get the routine to assign a plotstyle to the layer.

I'm attempting to set the plotstyle by using the
NEWLAYER.PlotStyleName = LAYPLOTSTYLE

where NEWLAYER is defined as the layer I'm creating and LAYPLOTSYLE is the
name of the style I want set to that layer.

Any help would be greatly appreciated

Back to top
Nathan Taylor
Guest





Posted: Wed Dec 08, 2004 3:00 am    Post subject: Re: Setting layer Plotstyle in VBA Reply with quote

The Help File specifies the property is

String; read-write (write-only for the Group object)
The plot style name for the object.

I interpret this to mean it is read only for all objects other than the Group object. I can't modify it manually in the layer properties dialog.

Regards - Nathan
Back to top
Kevin Schafer
Guest





Posted: Wed Dec 08, 2004 9:00 am    Post subject: Re: Setting layer Plotstyle in VBA Reply with quote

I read that in the help file. However I have another routine that changes
some existing layer settings that allows me to set the plotstylename. I've
compared the the two files and can't figure out why one is letting me set
the property and my new one is not.


"Nathan Taylor" <nospam@address.withheld> wrote in message
news:32123958.1102456854614.JavaMail.jive@jiveforum1.autodesk.com...
Quote:
The Help File specifies the property is

String; read-write (write-only for the Group object)
The plot style name for the object.

I interpret this to mean it is read only for all objects other than the
Group object. I can't modify it manually in the layer properties dialog.

Regards - Nathan


Back to top
Mike Tuersley
Guest





Posted: Wed Dec 08, 2004 9:54 pm    Post subject: Re: Setting layer Plotstyle in VBA Reply with quote

Is it safe to assume that the drawing is set to use STBs??? If the drawing
is set to use CTBs, then you cannot set a plot style for a layer.
-- Mike
___________________________
Mike Tuersley
CADalyst's CAD Clinic
Rand IMAGINiT Technologies
___________________________
the trick is to realize that there is no spoon...
Back to top
Kevin Schafer
Guest





Posted: Wed Dec 08, 2004 10:04 pm    Post subject: Re: Setting layer Plotstyle in VBA Reply with quote

Yes the drawing is setup to use .STB's and the correct plot style table file
is loaded and set as the default to be used for all drawings.

thanks

"Mike Tuersley" <mtuersley@rand.com> wrote in message
news:15s2vh4sklx7y.14yu8x4ch7l2u$.dlg@40tude.net...
Quote:
Is it safe to assume that the drawing is set to use STBs??? If the drawing
is set to use CTBs, then you cannot set a plot style for a layer.
-- Mike
___________________________
Mike Tuersley
CADalyst's CAD Clinic
Rand IMAGINiT Technologies
___________________________
the trick is to realize that there is no spoon...
Back to top
R. Robert Bell
Guest





Posted: Thu Dec 09, 2004 7:54 pm    Post subject: Re: Setting layer Plotstyle in VBA Reply with quote

The name-based plot styles need to exist in the drawing before you can
assign them to the layer's property. Just loading the .stb file is not
enough. The easiest way to make sure they exist is to assign each style to
an AcadEntity before you attempt to assign it to the Layer object.

--
R. Robert Bell


"Kevin Schafer" <kevin.schafer@mhs-eng.com> wrote in message
news:41b5e84a$1_2@newsprd01...
I'm trying to create a VBA routine which will create layers from a comma
delimited file. The file will contain all the layer setting including Name,
Freeze/thaw, On/off, Color, Linetype, Lineweight, Plotstyle. I have been
able to get the routine to create the layers with everything correct,
however I can't get the routine to assign a plotstyle to the layer.

I'm attempting to set the plotstyle by using the
NEWLAYER.PlotStyleName = LAYPLOTSTYLE

where NEWLAYER is defined as the layer I'm creating and LAYPLOTSYLE is the
name of the style I want set to that layer.

Any help would be greatly appreciated
Back to top
Kevin Schafer
Guest





Posted: Fri Dec 10, 2004 8:42 am    Post subject: Re: Setting layer Plotstyle in VBA Reply with quote

Thanks I'll try this and see if that fixes my problem
"R. Robert Bell" <NOT.RobertB@MWEngineers.com> wrote in message
news:41b86716$1_1@newsprd01...
Quote:
The name-based plot styles need to exist in the drawing before you can
assign them to the layer's property. Just loading the .stb file is not
enough. The easiest way to make sure they exist is to assign each style to
an AcadEntity before you attempt to assign it to the Layer object.

--
R. Robert Bell


"Kevin Schafer" <kevin.schafer@mhs-eng.com> wrote in message
news:41b5e84a$1_2@newsprd01...
I'm trying to create a VBA routine which will create layers from a comma
delimited file. The file will contain all the layer setting including
Name,
Freeze/thaw, On/off, Color, Linetype, Lineweight, Plotstyle. I have been
able to get the routine to create the layers with everything correct,
however I can't get the routine to assign a plotstyle to the layer.

I'm attempting to set the plotstyle by using the
NEWLAYER.PlotStyleName = LAYPLOTSTYLE

where NEWLAYER is defined as the layer I'm creating and LAYPLOTSYLE is the
name of the style I want set to that layer.

Any help would be greatly appreciated




Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB