Jump to content
  • 0

Modified Stake Tool


Bryan G.

Question

We need the ability to select an option to auto number stakes. Having 2000 stakes that are all #1, then having to go back and re number each one of them is a waste of my time and with these new fangled things called computers I would think this would be an easy fix.

Just a question do other people out there use the stake tool regularly?

Link to comment

8 answers to this question

Recommended Posts

  • 0
  • Vectorworks, Inc Employee

Hi Bryan,

This should do the trick. :)

This script will prompt you for a starting number, then it will set the ID Numbers sequentially for all selected Stake objects.

Copy all text in the quote below. You can paste it into a script, or a plug-in menu.

{

Number Stake Objects

By Matt Panzer - PanzerCAD

2012-06-14

DECRIPTION:

This script will prompt you for a starting number, then it will set the ID Numbers sequentially for all selected Stake objects.

}

PROCEDURE MAIN;

CONST

kpioObjName = 'Stake Object';

kpioRecName = 'Stake Object';

kpioRecFldName = 'ID';

VAR

ObjNum : LONGINT;

i : LONGINT;

{------------------------------}

FUNCTION NumObjFunc( ObjHand : HANDLE ) : BOOLEAN;

BEGIN

IF ( GetType( ObjHand ) = 86 )

AND ( GetName( GetRecord( FSActLayer, NumRecords(FSActLayer) ) ) = kpioObjName ) THEN

BEGIN

SetRField( ObjHand, kpioRecName, kpioRecFldName, Num2Str( 0, i ) );

i := i + 1;

ResetObject( ObjHand );

END;

END;

{ |||||||||| MAIN BEGIN |||||||||| }

BEGIN

ObjNum := COUNT(((T=PLUGINOBJECT)|(PON='Stake Object')) & (V) & (SEL=TRUE));

IF ObjNum = 0

THEN AlrtDialog( 'No selected Stake objects found. Please select some and try again.' )

ELSE

BEGIN

i := IntDialog( Concat( 'Number of Stake Objects found: ', ObjNum, Chr(13), 'Start at count number:'), '101' );

ForEachObjectInLayer( NumObjFunc, 2, 1, 2 );

END;

END;

RUN(MAIN);

Link to comment
  • 0
6 minutes ago, fsmvectorworks said:

I'm having an issue here where although I have stake objects selected, I'm still getting the error message of no stake objects selected.

Any thoughts on why this might be happening?

I am in 2023, so perhaps the naming of stakes has changed?

I've copied the stakes to a clean file which seems to work, this is a fantastic tool and has saved an awful lot of time thanks matt!

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
Answer this question...

×   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...