Jump to content
Developer Wiki and Function Reference Links ×

Looking for Script similar to Dimension Script


I3erk

Recommended Posts

im looking for a script that is similar to that of the dimensions for vectorworks. i want to see how, in the dimension script, that you can overide the dimension text value and input your own text.

i can't find a command that would do this :(

thanks

Link to comment

If you create a Custom Tool for Dimensions and add the following lines to the script, you can adjust these lines to control the font and size used for dimensions. Make sure you put these lines above the CallTool line.

TextFace (to set the font style)

TextSize (to set the font size)

TextFont (to set the font)

Look up these commands in the VectorScript Function Reference to find the parameters you need to add to them.

The PopAttrs command at the end of the custom tool will reset the font to the previous settings after the tool is fininshed.

Pat

Link to comment

thanks, but what if i just wanted to be able to overide the text,

like as an example, for dimensions, in the object info palette you can select to show the dim value or not, and you can overide it by typing into the leader text field and so on.

what kind of a command would this be ? like would it be under text or something different?, because i cant seem to find a command that would let me insert something i have written in my text parameter 'text field'

so like, is there such a command that will let me just insert any text i want in the same place as the dimension text would be ?and where would i be able to write in this new text ( in object info palette )

Link to comment

one other thing, for the SetDimText, what is the handle and the leadertrailer and what do they do? because the explanation VW gives isnt very clear to what should be placed into this command.

for example: VW says this..

Declaration:

PROCEDURE SetDimText(h :HANDLE; leaderTrailer :STRING);

Description:

Procedure SetDimText will set the dimension text of the referenced dimension to the specified value.

The maximum length for dimension text is 60 characters. The first 30 characters of the specified dimension text string will be displayed in the primary dimension string; the remaining characters will be displayed in the secondary dimension string, if it exists.

Parameters:

h Handle to a dimension object.

leaderTrailer Dimension text string.

Example:

SetDimText(dimHandle,'Length varies');

can you help me clear up what this means exactly?

thanks alot :grin:

Link to comment

You need a different command to turn off the text.

Check out SingleTolerance. It allows you to set the leader and trailer text and turn on or off the dimension text. If you set the last parameter (LimDistance) to 0 it does not display and tolerance.

SetDimText could also work, and it automatically hides the dimension number.

A handle is sort of like a telephone number. By using the handle, you can find an object without knowing where it is.

In this case you could use LNewObj to get the handle to the dimension after it is created. The LeaderTrailer field is actually the text (String) that you want to display instead of the dimension number. It is put into the Leader field in the OIP.

Pat

Link to comment

2 things, do i have to create a leader field for the SetDimText, and the other was if you can look at the code so far and see it if all works. ( it doesn't say that there is an error, but when i run it, it doesn't show a leader field.

Procedure DimmedRect;
Var OldStd:Integer;
        DIMS:Integer;

Begin
OldStd:=GetPrefInt(22);
SetPrefInt(22,0);
Rect(0,-pBoxWidth/2,pLineLength,pBoxWidth/2);


IF pTEXT then
   		Begin
		Moveto(0,pBoxWidth/2);
		Lineto(pLineLength,pBoxWidth/2);
		DimText; 

   		End
ELSE 
	Begin
		SetDimText(LNewObj,'12');
	End;

SetPrefInt(22,OldStd);


End;

but i think ill try and get the single tolerance command to work. it seems like it will be the best command to use

Edited by I3erk
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...