Jump to content

Fuge

Member
  • Posts

    157
  • Joined

  • Last visited

Posts posted by Fuge

  1. 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);

  2. I don't know what exactly everyone's experience has been with VW9.x.x, but I have found working with VW 9.5.1 in OS9 to be pretty stable given that you allocate a ton of ram to it. I find VW's doesn't start working good until it's given a minimum of 300mb's. Also I jumped into OSX about 5 weeks ago and have found VW's to be even more stable there. I have to say I've been pleasantly surprised and have yet to crash VW's.

    Dave

  3. 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);

  4. No Way to clear the clipboard but you can clear the undo history.Dave---------------------------------Procedure ClearUndos;{Clears the undo history}VARYes:BOOLEAN;BEGINSysbeep;Yes:=YNDialog('Are you sure you want to clear the undo history?');If Yes THENBEGINUndoOff;END;

    END;Run (ClearUndos);

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

  6. 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. tongue.gif" border="0

    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 ]

  7. Paolo,

    If I understand you correctly. You can changethe classes attached to different object withina PIO. I don't quite understand how your trying to do it. Sorry I can't be more helpful.

    Dave

  8. See if this does what you want.

    Dave--------------------Procedure RenameClasses;VAR

    ClassName,NewName:STRING;i: INTEGER;

    BEGINi:=1;

    REPEATClassName:= ClassList(i);NewName:= Concat( 'OS-',ClassName );RenameClass ( ClassName, NewName );i:=i+1;UNTIL i = (ClassNum+1);

    Sysbeep;AlrtDialog('Renaming classes is complete!');

    END;Run (RenameClasses);

  9. Another way to edit saved sheets-Go to the Window menu to Script Palettes to Saved Sheets. On Mac, while holding down the option key double on the sheet to edit it.Can't remember if it's the same for Windows.

    You can also do a command X to delete a saved sheet and command c ,command v to copy and paste a sheet as well.

    Dave

  10. I just looked in the workspace editorin VW9.5 and I have "Line into Segments...."odd that you don't have it and was told it doesn't exist any longer. Also I looked at vw 8.5 and have "Line into Segments...." there as well. Looking at the VW8.5 version the script doessn't have "Type" as a variable.

    At the top of any script there is an area where you need to define words that are place holders for values. A place to hold a number or word for example. These place holders can no longer be name "Type" because VW's uses that word internally for other specific tasks.Variable are listed under "VAR" in the script.

    Look in your script at i, nSegs, TVal, Type : INTEGER;

    Change the word "Type" to something unique like "Typexxx", there and anywhere elseit may appear in the script and the script should work.

    HTHDave

  11. Try this for scrolling through the class list and setting the active class.Dave wink.gif" border="0 -----------------Procedure CycleClasses;VARkeypressed:LONGINT;ClassName:STRING;i: INTEGER;

    BEGINi:=1;RepeatClassName:= ClassList(i);Message('Class Name: ',ClassName,', Hit the Return key to make this the active class.');GetKeyDown(keypressed);

    If KeyPressed = 29 THENBEGIN If i = ClassNum then BEGIN ClassName:= ClassList(i); Message('Class Name: ',ClassName,', Hit the Return key to make this the active class.'); i:=1; END ELSEBEGINClassName:= ClassList(i);Message('Class Name:',ClassName,', Hit the Return key to make this the active class.');i:=i+1;End;End;

    If KeyPressed = 28 THENBEGIN If i = 1 then BEGIN ClassName:= ClassList(i); Message('Class Name: ',ClassName,', Hit the Return key to make this the active class.'); i:= ClassNum; END ELSEBEGINClassName:= ClassList(i);Message('Class Name: ',ClassName,', Hit the Return key to make this the active class.');i:=i-1;End;End;

    UNTIL KeyPressed = 13;NameClass(ClassName);ClrMessage;END;Run (CycleClasses);

  12. George,

    Here's something written a while back that can be modified to fit your needs. Select the object and either add or edit the record attached. Add this as a menu plug-in item and give it a try. It should give you the idea on how it can be done in VS.

    Dave

    Procedure EditAddObjRec;{* Created by Dave Fugiel 2/13/99*}LABEL 10,99;

    CONST kRec = 'Nimlok DB';

    VAR Abort, Mac , yes : BOOLEAN; x , y : REAL; STR1 , STR2 , STR3 , STR4 , STR5 , STR6 , STR7 , STR8 : STRING; RF1, RF2 , RF3 , RF4 , RF5 , RF6 , RF7 , RF8 :STRING; Obhd , CustomObj : HANDLE; ObjectCount : LONGINT; ObjTyp : INTEGER; Recordhand,h ,RecordExist : HANDLE;

    Procedure AddtheRecord;BEGIN Recordhand:=GetObject(kRec); RecordExist := GetRecord(Obhd,1);

    IF Recordhand = Nil THEN BEGIN NewField(kRec, 'Code' , '',4,1); NewField(kRec, 'Description' , '',4,1); NewField(kRec, 'Price' ,'',6,2); NewField(kRec, 'Weight' , '',6,2); NewField(kRec, 'Rentable' , '',4,1); NewField(kRec,'WSR No','',6,0); NewField(kRec,'Pack No','',6,0); NewField(kRec,'Obj Type','',6,0);END;END; Procedure TheDialog;VAR Width,x1,y1,x2,y2,px1,px2,px3,px4,py1,py2,py3,py4 : INTEGER;

    Procedure AlignScr ( Height, Width : INTEGER; VAR x1, x2, y1 : INTEGER );VAR scrx1, scry1, scrx2, scry2 : INTEGER;

    BEGIN GetScreen ( scrx1, scry1, scrx2, scry2 ); x1 := ( ( scrx1 + scrx2 ) DIV 2 ) - ( Width DIV 2 ); x2 := x1 + Width; y1 := ( scry2 - scry1 - Height ) DIV 3;END;

    Procedure LocateButtons ( DialogType, scnh, scnw : INTEGER );VAR v1, v2, v3, v4 : INTEGER;

    Procedure Swap ( VAR m1, m2, m3, m4 : INTEGER );VAR Temp : INTEGER;

    BEGIN Temp := m1; m1 := m3; m3 := Temp; Temp := m2; m2 := m4; m4 := Temp;END; { of Swap }

    BEGIN GetVersion ( v1, v2, v3, v4 ); Mac := ( v4 = 1 );

    IF DialogType = 1 THEN BEGIN px1 := ( scnw DIV 2 ) - 80; px2 := ( scnw DIV 2 ) - 10; px3 := ( scnw DIV 2 ) + 10; px4 := ( scnw DIV 2 ) + 80; IF Mac THEN SWAP ( px1, px2, px3, px4 );

    py1 := scnh - 40; py2 := scnh - 20; py3 := py1; py4 := py2; END

    ELSE IF DialogType = 2 THEN BEGIN px1 := scnw - 180; px2 := scnw - 110; px3 := scnw - 90; px4 := scnw - 20; IF Mac THEN SWAP ( px1, px2, px3, px4 );

    py1 := scnh - 40; py2 := scnh - 20; py3 := py1; py4 := py2; END

    ELSE BEGIN px1 := scnw - 90; px2 := scnw - 20; px3 := px1; px4 := px2;

    py1 := scnh -70; py2 := scnh - 50; py3 := scnh - 40; py4 := scnh - 20; IF Mac THEN SWAP ( py1, py2, py3, py4 ); END;END; { of Locate Buttons }

    Procedure MakeDialog;CONST scnh = 335; scnw = 320; DialogType = 3;

    BEGIN AlignScr ( scnh, scnw, x1, x2, y1); y2 := y1 + scnh; LocateButtons ( DialogType, scnh, scnw );

    BeginDialog ( 1, 1, x1, y1, x2, y2 ); AddButton ( 'OK', 1, 1, px1, py1, px2, py2 ); AddButton ( 'Cancel', 2, 1, px3, py3, px4, py4 ); AddField ( 'Code:' , 3, 1, 10, 20 , 85, 35 ); AddField ( '' ,4, 2, 95, 20 , 305, 35 ); AddField ( 'Description:' , 5, 1, 10, 50 , 85, 65 ); AddField ( '' ,6, 2, 95, 50 , 305, 65 ); AddField ( 'Price:' , 7, 1, 10, 80 , 85, 95 ); AddField ( '' ,8, 2, 95, 80 , 305, 95 ); AddField ( 'Weight:' , 9, 1, 10, 110 , 85, 125 ); AddField ( '' ,10, 2, 95, 110 , 305, 125 ); AddField ( 'Rentable:' , 11, 1, 10, 140 , 85, 155 ); AddField ( '' ,12, 2, 95, 140 , 305, 155 ); AddField ( 'WSR No:' , 13, 1, 10, 170 , 85, 185 ); AddField ( '' ,14, 2, 95, 170 , 305, 185 ); AddField ( 'Pack No:' , 15, 1, 10, 200 , 85, 215 ); AddField ( '' ,16, 2, 95, 200 , 305, 215 ); AddField ( 'Obj Type:' , 17, 1, 10, 230 , 85, 245 ); AddField ( '' ,18, 2, 95, 230 , 305, 245 ); EndDialog;END;

    BEGIN MakeDialog;END;

    Procedure GetInfo;LABEL 10 , 99;

    VAR item : INTEGER; Done , OK : BOOLEAN;

    BEGIN Done := FALSE; Abort := FALSE; RF1 := ''; RF2 := ''; RF3 := ''; RF4 := ''; RF5 := ''; RF6 := ''; RF7 := ''; RF8 := ''; Obhd := LSActLayer; IF Obhd <> NIL THENBEGINAddtheRecord;

    RF1 := EvalStr ( Obhd , ('Nimlok DB'.'Code'));RF2 := EvalStr ( Obhd , ('Nimlok DB'.'Description'));RF3 := EvalStr ( Obhd , ('Nimlok DB'.'Price'));RF4 := EvalStr ( Obhd , ('Nimlok DB'.'Weight'));RF5 := EvalStr ( Obhd , ('Nimlok DB'.'Rentable'));RF6 := EvalStr ( Obhd , ('Nimlok DB'.'WSR No'));RF7 := EvalStr ( Obhd , ('Nimlok DB'.'Pack No'));RF8 := EvalStr ( Obhd , ('Nimlok DB'.'Obj Type'));END;

    GetDialog ( 1 ); SetTitle ( 'Edit/ Add Record Info' ); SelField ( 4 ); SetField ( 4, RF1 ); SetField ( 6, RF2 ); SetField ( 8, RF3 ); SetField ( 10, RF4 ); SetField ( 12, RF5 ); SetField ( 14, RF6 ); SetField ( 16, RF7 ); SetField ( 18, RF8 ); 10:REPEAT DialogEvent ( Item ); CASE item OF 1 : Done := True;

    2 : BEGIN Done := TRUE; Abort := TRUE; END; END; { of CASE }UNTIL Done; IF Abort THEN GOTO 99; STR1 := GetField ( 4 ); STR2 := GetField ( 6 ); STR3 := GetField ( 8 ); STR4 := GetField ( 10 ); STR5 := GetField ( 12 ); STR6 := GetField ( 14 ); STR7 := GetField ( 16 ); STR8 := GetField ( 18 ); 99 : ClrDialog; END; PROCEDURE ObjFrom;BEGIN

    IF Obhd <> NIL THEN CustomObj := Obhd ELSE CustomObj := LNewObj; END;

    Procedure AddRecordInfo; BEGIN ObjFrom; SetRecord ( CustomObj ,'Nimlok DB' ); SetRField ( CustomObj ,'Nimlok DB','Code',STR1 ); SetRField ( CustomObj ,'Nimlok DB','Description', STR2 ); SetRField ( CustomObj , 'Nimlok DB' , 'Price' , STR3 );

    SetRField ( CustomObj , 'Nimlok DB' , 'Weight' , STR4 ); SetRField ( CustomObj , 'Nimlok DB' , 'Rentable' , STR5 ); SetRField ( CustomObj , 'Nimlok DB' , 'WSR No' , STR6 ); SetRField ( CustomObj , 'Nimlok DB' , 'Pack No' , STR7 ); SetRField ( CustomObj , 'Nimlok DB' , 'Obj Type' ,STR8 ); END; BEGIN ObjTyp := GetType ( LSActLayer );

    IF LSActlayer = NIL THEN BEGINSysbeep; AlrtDialog ( 'Select something to edit first knuckle head!' ); GOTO 99; END;

    ObjectCount := Count ( ( SEL = TRUE ) ); IF ( ObjectCount > 1) & ( ObjTyp <> 11 ) THEN BEGIN Sysbeep; AlrtDialog ( 'Sorry, You have more than one object selected, Select only one!' ); GOTO 99; END;

    TheDialog; GetInfo; IF Abort THEN GOTO 99;AddRecordInfo;99 : END;Run ( EditAddObjRec );

  13. If I understand you correct.

    Draw a circle and a 2d locus side by side.The distance of your 2d locus from your circle will be the radius of your spring. Selectboth and do a menu "Sweep.." command. enter the degrees and a pitch to create your spiral spring.

    Fuge

    • Like 1
  14. There are many objects that do not get exported when exporting as a vector script file.

    Your drawing will never end up importing back in the way it was when it was exported.

    I would find an alternative way of setting up your revision control system.

    Dave

  15. Vectorworks really needs the ability to truely communicate with other databases. Exportingor writing text files to be read by another program doesn't cut it.

    Third party developers have tried writing plug-ins to exchange data between VectorWorks and other programs that support ODBC, but these solutions just don't work and are not very well supported. I have first hand experience.

    So where does that leave users who need this higher end feature that other CAD program already provide?

    I believe that NNA does NOT realize the importance of this feature and how important it will become to the future of VW's. Larger firms will never even consider VW's as a solution if data exchange is not part of the products.

    NNA bases their future product features two ways. Are enough people asking for the feature and how easy is it to implement.I already know this would take considerable resources to add to VW's, so that means a lot of people need to ask for this feature for it to have a hope in hell.

    So, if anyone out there feels they need this feature please speak up and post your two cents. Show NNA there is a need for this feature.

    Dave

  16. Gordon, Here's a quick modification of your scriptto show reading each line. VS automaticallyresets and starts at the BOF for you.HTHDave

    PROCEDURE A_test;CONSTfilespec ='The output';VARa1,a2,a3,a4,a5,a6,a7,a8 :REAL;b1,b2,b3,b4,b5,b6,b7,b8 :REAL;

    BEGINa1 := 1.1;a2 := 2.2;a3 := 3.3;a4 := 4.4;a5 := 5.5;a6 := 6.6;a7 := 7.7;a8 := 8.8;Rewrite(filespec);WriteLn(a1);WriteLn(a2);WriteLn(a3);WriteLn(a4);WriteLn(a5);WriteLn(a6);WriteLn(a7);WriteLn(a8);Close(filespec);

    Open(filespec);WHILE NOT EOF(filespec) DOBEGIN StdRead(b1,b2,b3,b4,b5,b6,b7,b8); Close(filespec); Message(b1,' ',b2,' ',b3,' ',b4,' ',b5,' ',b6,' ',b7,' ',b8); Wait (3); Clrmessage;END;END;RUN(A_test);

    [ 04-22-2002: Message edited by: Fuge ]

  17. Sorry to say, but beyond what vectorscript can do. Vectorscript does not give you the ability toauto - name and save files, much less set pre-defined parameters to export files by. If were extremely lucky maybe the next version of Vectorworks might allow us to do some batching with vectorscript.

    Dave

×
×
  • Create New...