Jump to content

Assembly

Member
  • Posts

    430
  • Joined

  • Last visited

Posts posted by Assembly

  1. I use time machine. Excellent.

    I have three portable hardrives.

    One sits constant on the main computer.

    One is in a safe.

    One comes home.

    Each time you switch out your hardrive reset the Time machine to the reinstalled drive. It is easy.

    If you have a small amount of data and lots of bandwidth dropbox.com is a good option.

    Store your files in the dropbox. Keep one of your old machines offsite with a linked dropbox. This keeps copies in your local drive, the cloud, and anywhere else you have another link. Caution though if you delete a file in one location it removes it from all. However if you add a Timemachine drive to the remote computer then your covered.

    As a note on dropbox- we have a shared VW preference folder stored in our drop box. This means that when one person adds a favorite file, or creates a new plug in it updates all the workspaces in the office.

  2. Function Profile2DrawType1(VAR ProfileRepeats: Real):Handle;

    BEGIN;

    Rect(0,0,300,10);

    Profile2DrawType1:=LnewObject;

    ProfileRepeats:=310;

    END;

    Function SelectProfile2ExtrudeAndRepeat(Profile:Handle):Handle;

    BEGIN;

    hTemp:=hExtrude(Profile,0,100);

    hDuplicate(hTemp, ProfileRepeats,0);

    END;

    __________

    Used like this:

    HTemp:=SelectProfile2ExtrudeAndRepeat(Profile2DrawType1);

    Sorry, I was not clear, As you point out Pat I should have had the VAR.

    Here is the problem...

    When Profile2DrawType1 is called in SelectProfile2Extrude I can't figure out how to fetch the RepeatProfile value from inside the SelectProfile2Extrude function.

    The SelectProfile2ExtrudeAndRepeat(requires a Handle to Draw). Profile2DrawType1 draws a shape and gives it a handle.

    This works fine the extrude is created.

    BUT, as I use the Profile2DrawType1 inside the variable settings of SelectProfile2ExtrudeAndRepeat-

    HTemp:=SelectProfile2ExtrudeAndRepeat(Profile2DrawType1);

    I don't see how to get the value through.

  3. Thanks everyone. New problem.

    I want to use a function to pass an handle and real inside another function.

    Something like this: (Miguel I do check for NIL but striped for quick reading)

    Function Profile2DrawType1(ProfileRepeats:Real):Handle;

    BEGIN;

    Rect(0,0,300,10);

    Profile2DrawType1:=LnewObject;

    ProfileRepeats:=310;

    END;

    Function SelectProfile2ExtrudeAndRepeat(Profile:Handle):Handle;

    BEGIN;

    hTemp:=hExtrude(Profile,0,100);

    hDuplicate(hTemp, ProfileRepeats,0);

    END;

    __________

    Used like this:

    HTemp:=SelectProfile2ExtrudeAndRepeat(Profile2DrawType1);

    This works to draw the profile to extrude.

    But I don't know how to to get the value returned for the ProfileRepeat value.

    Can anyone help me... with this?.

  4. GetBBox(hLine,x1,x2,y1,y2);

    MEssage('x1:',x1,' x2:',x2,' y1:',y1,' y2:',y2);

    Can someone else test this.

    Documentation states:

    GetBBox(hLine,x1,x2,y1,y2);

    But I am getting:

    GetBBox(hLine,x1,x2,y2,y1);

    That is the Y2 and Y1 are reversed.

  5. The result of this function, inside a PIO creates and 'exploded' bunch of nurb surfaces.

    Using the menu extrude along a path creates a solid extrude.

    Major difference.

    Who knows how to make an exturde along a path that remains and extrude thus allowing further add / subtract functions to happen?.

  6. VSFR has a good replacement for hExtrude.

    How Orso figured this out to start with is genius.

    { ***************************************** }

    { Orso.B.Schmid, creates an extrude from a HANDLE h,

    preserving the original h. Returns a handle to the extrude }

    FUNCTION Create3Dobj(h: HANDLE; z, dZ: REAL): HANDLE;

    BEGIN

    IF h <> NIL THEN BEGIN

    BeginXtrd(z, dZ);

    LineTo(1, 1);

    { just draw something for creating an extrude container }

    EndXtrd;

    DelObject(FIn3D(GetParent(CreateDuplicateObject(h, LNewObj))));

    { places a copy of h in the extrude and deletes the line }

    Create3Dobj := LNewObj;

    END;

    END;

    BUT there is a minor bug in the code above.

    The object extrude uses LineTo(1,1);

    If the cursor is already at (1,1) then the line is not drawn and the extrude is not created.

    Easy fix is this:

    { ***************************************** }

    { Orso.B.Schmid, creates an extrude from a HANDLE h,

    preserving the original h. Returns a handle to the extrude

    }

    FUNCTION Create3Dobj(h: HANDLE; z, dZ: REAL): HANDLE;

    BEGIN

    IF h <> NIL THEN BEGIN

    BeginXtrd(z, dZ);

    MoveTo(0,0);

    LineTo(1, 1);

    { just draw something for creating an extrude container }

    EndXtrd;

    DelObject(FIn3D(GetParent(CreateDuplicateObject(h, LNewObj))));

    { places a copy of h in the extrude and deletes the line }

    Create3Dobj := LNewObj;

    END;

    END;

    Orso If your out there you might update VSFR.

    Thanks

  7. This is what I'm after in the most simple terms.

    I want my function to return more than one Variable.

    IE

    FUNCTION DrawShapeGiveHandle(AndReturnWidth:REAL): HANDLE;

    BEGIN;

    Rect(0,0,1000,100):

    DrawShapeGiveHandle:=lNewObj; {this gives me a handle to my shape}

    AndReturnWidth:=1000; {this returns the width of shape}

    END;

    So I can do something like this

    hTemp:=hDuplicate(DrawShapeGiveHandle(RealTemp),RealTemp,0);

    This would allow me to duplicate the shape and return the width to space the duplicate all in one handy function.

  8. The BASE Level object always uses a Number as the Variable.

    IE

    Width:=pWidth;

    Depth:=pDepth.

    The SECOND Level object uses a pop up selector and creates the logic of how to size the BASE object.

    ie

    IF pPopUp='200x50' Then

    Begin;

    SetRfild(pioName,PIOHandle, 'Width', 50);

    SetRfild(pioName,PIOHandle, 'Depth', 200);

  9. Here is a good one for you PIO developers.

    FindAndReplace will find all of an old PIO and insert a new version.

    It would be great if some one with a bit of dialog experience could wrap one around this....

    PROCEDURE SHELL;

    {*/ This Procedure will searh a file and upgrade all instances of a PIO

    It can be used for PIO's that have the same parameter Names

    **}

    PROCEDURE FindAndReplace(oldPIOName:String;upgradeName:String);

    PROCEDURE FindReplace(hObject:Handle);

    VAR

    x1,y1:Real;

    hLayer:HANDLE;

    LayerName: STRING;

    NewObject: Handle;

    hNewObject:Handle;

    recName:String;

    recHand:Handle;

    Cnt:INTEGer;

    fldName:STRING;

    PassText:String;

    BEGIN;

    GetSymLoc(hobject,x1,y1); {*/Get insert point of existing PIO}

    hLayer:=GetLayer(hObject);

    LayerName:=GetLName(hLayer);

    Layer(layerName); {*/Change to the layer of the Existing PIO}

    hNewObject:= CreateCustomObjectN(upgradeName,x1,y1,0,False); {*/Inserts the new Object over the old one}

    recName := GetName(GetRecord(hObject, NumRecords(hObject))); {*/Get Record Name of existing PIO-This is entered anyway}

    recHand := GetObject(recName); {*/Get Handle to Record}

    FOR cnt := 1 TO NumFields(recHand) DO BEGIN {*/For each of the parameters in the object}

    fldName := GetFldName(recHand, cnt); {*/Get the Parameter Name}

    PassText:=GetRField(hObject,recName,fldName); {*/ Get the Value}

    SetRField(hNewObject,upgradeName,fldName,PassText); {*/ Pass the Value into the Parameter of the New Object}

    END;

    END;

    Begin;

    ForEachObject(FindReplace, INSYMBOL & INOBJECT & INVIEWPORT & (PON=oldPIOName));

    END;

    BEGIN;

    FindAndReplace('NZ Master Spec Note','NZ Master Spec Legend');

    END;

    Run (SHELL);

    {Code Written By Justin Wright 2010}

    {This program is free software: you can redistribute it and/or modify

    it under the terms of the GNU General Public License as published by

    the Free Software Foundation, either version 3 of the License, or

    (at your option) any later version.

    This program is distributed in the hope that it will be useful,

    but WITHOUT ANY WARRANTY; without even the implied warranty of

    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License

    along with this program. If not, see .}

  10. The object is a 3D wall detail tool.

    Essentially it draws a timber framed wall with all its parts.

    Draws Timber Floor Framing

    Draws Timber Flooring

    Draws Timber Wall framing

    Draws Building Wrap

    Draws Cavity batten

    Draws Cladding

    (we can add most cladding types in about 5mins);

    Draws Window

    Draws Flashing Tape

    Draws Sill & Head Flashings

    Draws Claddings

    Draws Timber Rafters

    Draws Roof Underlay

    Draws Roofing

    Draws Gutter Flashing

    Draws Gutter Profile

    It is completely parameteric allowing for any roof pitch, height, frame size, window size.

    Nesting.

    Level 1

    Single pane of glass.

    Double glazing spacer

    Level 2

    Double Glazing Unit.

    Uses above to make a DG unit.

    Level 3

    DG goes into a Window Object.

    With

    Aluminum Window Profile Extrusion

    Level 4 Window Component Object ready for wall.

    Adds Head Flashing

    Window liners

    Sill heights.

    Allows for adjustment of object to fit in the depth of the wall.

    Level 5

    The Wall object itself

    This has over 100 parameters

    Next Step is to create a 6th level object that simplifies the parameter interface to reduce the number of settings

  11. If you want to load use an external file use the XML functions.

    Here is a snippet to get started.

    When you script is executed you will want to write to the XML file

    what the old class was and what the new class is

    When you load your script you will want to load the XML file and see if there are any classes to be reassigned with defaults if so set the default.

    ___________________

    PROCEDURE GetXML;

    CONST

    kLibraryFolder =-13; {constant to set the file path to the VW library folder}

    VAR

    hXML :LONGINT;

    xmlFile :STRING;

    result :INTEGER;

    BEGIN;

    hXML := InitXML;

    IF hXML <> 0 THEN BEGIN

    xmlFile := 'ClassAssign.xml';

    result := ReadXMLFile(hXML, kLibraryFolder, xmlFile);

    DATAPath:=Concat('/Prefs/',ClassName[]); {defines the classname path, upto you how to this is structured.}

    result := GetElementValue(hXML, DATAPath, NewClassName[]));

    {this will return the value to NewClassName[]}

    result := ReleaseXML(hXML);

    END ELSE BEGIN

    SysBeep;

    Message('Could not initialize XML reader.');

    END;

    END;

  12. a couple snippets.

    Place this just after you text creation

    GetBBox(lnewobj,x1,y1,x2,y2);

    Moveto(x1,y1);lineto(x2,y1);lineto(x2,y2);lineto(x1,y2);lineto(x1,y1);

    This will draw a tidy box around your text.

    3. Yes you can insert PIO inside other PIO and adjust the parameters. If you do you are treading in unchartered territory. I started a few posts mid last year. With little response from anyone...

    Since then we have been using nested PIO extensively. Objects are nested 3-4 layers deep. I have found that 3D objects perform better than 2D. Sometimes 2d lines don't generate. It can be a bit buggy, but I have found this technique very useful.

    Here is the general layout of how it is set up:

    VAR

    ObjectName:STRING;

    HObject: HANDLE;

    DadVar: REAL;

    MumVar:STRING

    GrandMaVar:Boolean;

    ObjectName:='The_PIO_You_Will_Install';

    HObject:= CreateCustomObjectN(ObjectName,0,0,0,False);

    SetRField(HObject,ObjectName,'VarNameOfChild1_Int',Num2Str(1,DadVar));

    SetRField(HObject,ObjectName,'VarNameOfChild2_Str',MumVar));

    Note use of Num2String.

    All values passed to your child PIO need to be passed as Strings.

    Now where you will often trip up is getting the parent and child variables mixed.

    VAR

    GrandMaVar: Boolean;

    SetRField(HObject,ObjectName,'VarNameOfChild3_Boo',GrandMaVar));

    This will not work.

    VarNameOfChild3_Boo is a Boolean.

    and GrandMaVar is Boolean

    BUT you must always pass a STRING in.

    GradMaVar which is going to be used to control the Boolean in the child needs to be a string in the Parent

    GrandMaVar:=True; {Boolean}

    is ver different to

    GrandMaVar:='True'; {String}

    Get it?.

  13. Thanks Miguel

    I can't find a way to fully automate generation of PDF. I was thinking i could do this through SDK, from your explanation I am sure I can.

    but;

    time i have to learn c++:= NIL;

    Still if there is a SDK guru out there I am sure there are a few scripters lurking here that would like to see a YouTube of how to set up and get going.

  14. More testing.... Yes nested worked!

    I did have a the include file structure looking like this:

    {$INCLUDE /Dropbox/AssemblyScript/Plug-Ins/0TestShell2}

    Which works fine inside the VW plug in script.

    To get the nested path to work I changed it to

    {$INCLUDE Lap13 HD:Dropbox:AssemblyScript:Plug-Ins:0TestShell2}

    Okay good. BUT now I have a new problem.

    I use Dropbox (www.dropbox.com) to sync my Vectorworks Setting across my three computers. Each computer has dropbox installed and sharing a folder VW 2009 Settings. On each computer I set the VW preference I set my user folder to this folder.

    Hence

    IF

    I add a plug-in and edit my workspace on one computer

    THEN

    Dropbox updates the folders on the other computers- thus we have identical set up on all computers in the office by just changing one. This work a treat.

    BUT

    All my plugins use $Include with the file path: /dropbox/../../

    if I go and change my file paths to using Lap13 HD:Dropbox:..:.. then as each computer has a different drive name I will have a different problem.

    Bugger.

×
×
  • Create New...