Jeff Simpson Posted May 30, 2002 Share Posted May 30, 2002 I need to number ( and then renumber/revise numbers) of couple hundred symbols all linked to the same database. Is there already a good solution out there? Thanking in advance... JS Quote Link to comment
Jeff Simpson Posted May 30, 2002 Author Share Posted May 30, 2002 CONT... I am a beginner so the solution needs to be geared for beginners ;-) JS Quote Link to comment
Fuge Posted May 30, 2002 Share Posted May 30, 2002 Jeff, Tell us what you want to number exactly.a record field attached to a symbol?What criteria does your worksheet use tofind and count the symbols? More infowould be helpful. Dave Quote Link to comment
Jeff Simpson Posted May 30, 2002 Author Share Posted May 30, 2002 Your right about it being a record field attached to a symbol. I would want to select them manually (by using the select tool). I don't know how to "count them". Could it count left to right? I'm not sure how that would work. JS Quote Link to comment
Fuge Posted May 31, 2002 Share Posted May 31, 2002 Jeff,Set the constant MyRecord and MyField to match the record and field your wanting to number, select your objects to number and this should do the trick. Dave--------------Procedure Numberthem;CONSTkRecName='MyRecord';kRecField='MyField'; VARobjhandle:HANDLE;NumberString:STRING;Num:REAL; BEGINNum:=1; objhandle :=FSActLayer; WHILE Objhandle <> NIL DO BEGINSetRecord ( Objhandle , kRecName );NumberString:=Num2Str(0 , Num); SetRField ( Objhandle , kRecName , kRecField , NumberString );Num:=Num+1;Objhandle := NextSObj ( Objhandle );END; END;Run (Numberthem); [ 05-30-2002: Message edited by: Fuge ] Quote Link to comment
Jeff Simpson Posted May 31, 2002 Author Share Posted May 31, 2002 Cool Dave. I'll give it a shot. How does it decide which order to number the objects? left to right or ??? JS Quote Link to comment
Matthew Giampapa Posted May 31, 2002 Share Posted May 31, 2002 This is an area I wish I knew more about, but from reading the script, it should do them in the order they were drawn. Matthew GiampapaNNA Technical Support Quote Link to comment
Fuge Posted May 31, 2002 Share Posted May 31, 2002 Funny you asked that. The command FSActLayer is for "first selected object on the active layer" So objects should be numbered in the order they are selected, However FSActLayer doesn't seem to be working correctly in VW9.5.1 mac. No matter the order you select the objects everything is numbered in the order they were created. Same goes forusing FSObject(); A couple for the bug list I believe. Dave Quote Link to comment
Vectorworks, Inc Employee klinzey Posted May 31, 2002 Vectorworks, Inc Employee Share Posted May 31, 2002 FSActLayer returns the "first selected object on the active layer", but not necessarly the first item that you selected. Selection is a binary state, either an item is selected or not, you canot tell how the objects were selected. ie, what would the order be is the objects were part of a marque selestion? In order for a numbering script to work you need to make a tool that numbers as you click on the object. To get you started you want to use GetPt(x,y) to get the mouse location when you click then use PickObject(x,y) to get the handle to the object or GetPickObjectInfo if the objects might be in a wall. Here is what the main part of the script should look like. GetPt(x,y);ObjHand := PickObject(x,y);while Objhandle <> NIL doBeginSetRecord ( Objhandle , kRecName );NumberString:=Num2Str(0 , Num); SetRField ( Objhandle , kRecName , kRecField , NumberString );Num:=Num+1;GetPt(x,y);ObjHand := PickObject(x,y);End; [ 05-31-2002: Message edited by: klinzey ] Quote Link to comment
Fuge Posted May 31, 2002 Share Posted May 31, 2002 Thanks for the clarification Kev. The description for FSActlayer fooled two of us. Also heres the complete revised script.---------------------------------------------Procedure Numberthem;CONSTkRecName='MyRecord';kRecField='MyField'; VARobjhandle:HANDLE;NumberString:STRING;Num,x,y:REAL; BEGINNum:=1;GetPt(x,y);Objhandle := PickObject(x,y);while Objhandle <> NIL doBeginSetRecord ( Objhandle , kRecName );NumberString:=Num2Str(0 , Num); SetRField ( Objhandle , kRecName , kRecField , NumberString );Num:=Num+1;GetPt(x,y);Objhandle := PickObject(x,y);End; END;Run (Numberthem); Quote Link to comment
krw Posted June 5, 2002 Share Posted June 5, 2002 Just used this script and it worked very well. Can i change how it nmubers, for example start at 101 instead of 1? I have never used scripts before, so I am unfamilar with the language and how they work. Quote Link to comment
Fuge Posted June 5, 2002 Share Posted June 5, 2002 Try ThisDave-------------------------Procedure Numberthem;CONSTkRecName='MyRecord';kRecField='MyField'; VARobjhandle:HANDLE;NumberString:STRING;Num,x,y:REAL; BEGINNum:=RealDialog('Enter a starting number:','1');GetPt(x,y);Objhandle := PickObject(x,y);while Objhandle <> NIL doBeginSetRecord ( Objhandle , kRecName );NumberString:=Num2Str(0 , Num); SetRField ( Objhandle , kRecName , kRecField , NumberString );Num:=Num+1;GetPt(x,y);Objhandle := PickObject(x,y);End; END;Run (Numberthem); Quote Link to comment
Recommended Posts
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.