Jump to content

Using Custom Tool/Attribute


Recommended Posts

Hello,

I'm trying to do a very simple thing in a simple way.  I want to be able to select an object and fill it with a color without having to do it manually in the Attributes palette.  Seems like the Custom Tool/Attribute function is the way.  It's supposed to create a macro based on the attributes of an existing object.  I followed the extremely simple instructions in the online manual, it made a script, but nothing happens when I select a new object and double-click the script.  No idea why, and the guy I spoke with in tech support *refused* to provide help because "we don't do scripting."  Very nice.

 

Can anyone provide some insight into how this tool works?  Thanks!

Link to comment

Custom Tool/Attribute creates a script that will set the Tool and Attributes so you can draw a new object using those settings.

 

It sounds like you want to be able to apply a set of settings to an already existing and selected object.

 

The below script is probably overly complicated, but it was the easiest way I could think of to have the script effect every selected object instead of just one object at t time.

 

We will be glad to help you set this up to meet your needs.  Grab the RGB Color values you want from the Color Palette Manager and enter them in the script. If you want to do patterns on the objects instead of just a solid color, the codes you need for the SetFPat command are in the Vectorscript Appendix.

 

Ask again as you need more help.

Procedure SetSelectedAttributes;

{April 28, 2022}
{©2022 Patrick Stanford pat@coviana.com}
{Licensed under the GNU Lesser General Public License}

{No Warranty Expressed of Implied. Use at your own risk.}

VAR
	R1,G1,B1, R2,G2,B2	:LongInt;
	
	Procedure Execute(Hd1:Handle);
		BEGIN

			SetFPat(Hd1,2);  			{Solid Fill Patern}
			SetFillBack(Hd1, 65535,0,0);	{Pure Blue Color, pass RGB Values of preferred color}
			SetFillFore(Hd1, 0,0,65535);	{Pure Blue Color}
			{Fill Fore is used for an object with a Pattern of 2 for a solid color}
			
			{You can do similar things to the above for the other attributes}
			{The settings for the Pen are commented out below.}
{			SetPenFore(Hd1, 256,0,0);
			SetPenBack(Hd1, 0,0,0);
}		End;
		
BEGIN
	{The folloiwng line executes once for each visible selected object in the drawing}
	ForEachObject(Execute, ((VSEL=TRUE)));
End;

Run(SetSelectedAttributes);

 

Link to comment

The eye dropper tool is the quickest way to take the attributes of one object and apply them to others. I use it all the time.

 

The custom tool command is good for creating new objects with preset attributes. I have a bunch of scripts made from the custom tool command. When I dble click the script it selects a tool I use to draw an object( line, polygon, rectangle, wall tool etc) and when I draw the object it will be on a preset class with the correct line weight hatch fill etc. It saves a lot of time.

  • Like 1
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...