Jump to content
Developer Wiki and Function Reference Links Read more... ×
Sign in to follow this  
David Poiron

gradient fill angle

Recommended Posts

I am trying to set the gradient fill angle of a wall, based on its rotation angle. I have found a number of vectorscript procedures that are for gradient fills, but do not know how to tie them together to determine the fill angle. Anyone know how this might be done?

Share this post

Link to post

I don't know a lot about this but you might want the look at:

SetObjectVariableReal(ObjHandle,Index,angle(in radians))

I found this when exporting to vectorscript a rectangle with a gradiant.

Share this post

Link to post

SetObjectVariableReal(FSActLayer, 74, Deg2Rad(10));

will set the Gradient angle to 10 degrees in the first selected object on the active layer, assuming it has a gradient fill.

I played with Gradients extensively 5 years ago and it was not easy. Luckily, I've forgotten most of the headaches. Your best bet to see how they work is to create an object with a gradient fill, duplicate it and distort the copies, then export the file to a VectorScript file and try to see what changes among your objects.

The good news is Image Fills are worse.

As Dave Carpenter pointed out, the angle must be expressed in Radians.



Share this post

Link to post


Thanks for your response, I apologize for not seeing it earlier. Unfortunately I'm very familiar with the same headaches you had years ago. I'm still in the process of figuring things out but the functions below have been helpful so far. We'll see how far they get me.



Still figuring things out, I'll keep you updated...


Share this post

Link to post

I was finally able to get my gradient to map correctly using:

SetFillOriginPoint(handle,AGRAD.x,AGRAD.y); {begining point of the gradient}

SetFillIAxisEndPoint(handle,BGRAD.x,BGRAD.y); {ending point of the gradient}

but wound up not having to use SetFillJAxisEndPoint(handle,AGRAD.x,AGRAD.y); in my script.


Share this post

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  


7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114


© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.