Jump to content
Developer Wiki and Function Reference Links ×

Setting Pen Pattern etc. to "By Class"


Bret

Recommended Posts

In a Command we've written to call out hardware on a plan, we currently use PenSize, PenPat, and FillPat to set visual defaults for a line and some text, but I'd like to force these to be by "By Class" when created. Is there a way to do this?

I've taken a look through the forum and the online VectorScript reference, but I haven't run across anything helpful yet. (I see how you can use FFPatByClass etc. to query whether this is the case, but not how to force the setting.)

UPDATE:

Okay, I've figured out one way to do it by using SetLSByClass(LNewObj) etc. after every created object, but it would be nice to be able to set all of those things globally at the beginning of the code.

(It seems that leaving the "Use at Creation" box for the class checked would solve much of this, but it doesn't seem to work for the fill pattern setting if you have it set to "None.")

Edited by Bret
Link to comment

Miguel,

Thanks for reminding me of those. We had actually used those in some old scripts, but I had forgotten about them.

After switching to use those, I'm having an issue with text coming out set to solid fill, even when the class setting is for 'None' (not to mention that 'Use at Creation' is checked for the class and that 'Create text without fill' is checked in my VectorWorks Preferences). For some reason, this happens whether or not I include FPatByClass in the code.

However, I just discovered that if I turn off 'Create text without fill,' it works correctly and gives me unfilled text set to 'By Class.' I think it's time to file a bug.

Link to comment

My preference is also to have it come out on 'By Class' so that it could be globally edited later should I want to do so. In my case, it should be created with the 'By Class' default fill of 'None' regardless of the 'Create text without fill' setting.

Manually setting it to either filled or unfilled doesn't do what I'm aiming for. There is a conflict between FPatByClass and 'Create text without fill,' which I've now reported; the sequence of operations I gave them to replicate the problem is listed below, if you're interested...

1) Create a new blank document

2) Create the XXXXX class referred to below and set its default fill pattern to 'None'

3) Check the VectorWorks 'Create text without fill' option

4) Create a new VectorScript as shown below

5) Run the VectorScript -> the text is incorrectly created with a fill

6) Uncheck the VectorWorks 'Create text without fill' option

7) Run the VectorScript again -> the text is correctly created with fill set to 'By Class' (None)

--------------------

BEGIN

PushAttrs;

NameClass('XXXXX');

FPatByClass;

TextOrigin(0,0);

BeginText;

'This text should not be solid'

EndText;

END;

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...