Jump to content

Alexandre Villares

  • Posts

  • Joined

  • Last visited

Posts posted by Alexandre Villares

  1. Sorry for the cross-posting...

    I'm using an image in a dialog, it stopped showing on VW 12.5 & 2008 on Windows. Previously, resource file extension changes broke my scripts on the PC, now I think it might be something similar. On the Mac, works fine.

    kResourceFile='myimage';  {on Windows that gets myimage.qtr file inside the Plug-ins folder}
    {...further down...}
    gOKdlog :=  SetVSResourceFile(kResourceFile);
          gDlogID := Define_Dialog;
          IF gOKdlog & VerifyLayout(gDlogID)
                  THEN gDlogResult := RunLayoutDialog(gDlogID,Drive_Dialog);
    {...inside the dialog code...}
    CreateControl(dialogID, 2, 1, kResourceFile, 1010);

  2. Wall Style component attributes override class attributes - this kills VW12 new edit viewport class attributes feature for walls.

    Say you want to show walls in black in one viewport, and the same walls in red in the other. On VW12 (with un-styled classed walls) you can! Great!

    - Now if you use wall styles you just can't. Frustration.

    I wish wall style component attributes could be 'by (chosen) class' - this would fix it.



  3. Hi help_arch,

    Unfortunately I think there is no VectorScript way of changing the default line thickness (those at the Attributes palette).

    Those are VectorWorks settings (in oposition to document settings) inacessible through VectorScript.



  4. Cut 3D Section command was taken out of the new standard (designer/architect) workspaces.

    At the Workspace Editor one can see it was assigned to the Legacy category.

    I believe this move shows NNA intention to remove the command on newer versions of VectorWorks and I think they must believe that Section ViewPorts make Cut 2D/3D Section commands obsolete.

    I beg to disagree.

    There is no way to achieve certain results (isometric sections, section study models) without using Cut 2D & 3D Section commands.

    Section Viewports are great but they do not (yet) replace completly the Cut 2D & 3D section commands (specially the Cut 3D Section) for certain uses.

    Please NNA, don't take away those commands from your users!

    Alexandre Villares

  5. Hi,

    After the user flipped the object using the mirror tool IsObjectFlipped will return TRUE and your code should counter-act it (the result is a flipped object as expected by the user). Then if the user reshapes the line, the PIO is 'magically' unflipped, and your code gets back to the normal mode (and no one should notice the difference). But again, I can't remember if I coded for the over/under the line difference.

    My sample code acts differently acording to angles in certain quadrants, and a manual OIP pFlip parameter to override it (that's the 'f' flag).

    IsObjectFlipped will be dealt by the 'f2' flag (to set Text Vertical Alignment and Y origin position) and will also invert LRot angle (LROt:=-LROt). This is the critical stuff.

    [ 09-08-2005, 01:58 PM: Message edited by: Alexandre B A Villares ]

  6. Hi Mike,

    You can have two dimension units.

    'Gringos' ;-) use this to show inches and centimeters side by side, but you can use this to your own purposes:

    Create a custom dimension (document preferences > dimensions > custom) and set the dual view to primary or secondary.

    At the Units panel, set the primary dimension objects and secondary...

    Now you can change dimension objects at the Obj. Info. palette to show either kind of units.



  7. Hi islandmon,

    I think I don't understand exactly what you want to do.

    My example should work as a plug-in object, it shouldn't use MouseDown, and it should be set to regenerate (redraw) when moved, so retrieving it's own new position. The text inside de object should be set using it's internal coordinate system, that is 0,0 like my earlier exemple.

    I didn't run your code yet but I think you must be running it as a tool. That's a very different approach.

    To run as a tool, you should not use the GetCustomObjectInfo and would draw free standing text objects using the drawing coordinates, perhaps on the MouseDown position...

    [ 09-08-2005, 01:25 PM: Message edited by: Alexandre B A Villares ]

  8. quote:

    Originally posted by Bruce Pittard:

    How about an option when creating double polygons or double lines if they kept their information so the width, cavities etc can be modified in the object info. This would be very handy with variations.


    Why not use walls instead? They have exactly this property you described.



  9. Hi,

    A VectorScript recipe for you...

    - Go to Organise > Scripts > Create Plug-in...

    - Press 'New...', give it a name, choose 'Point Object' and press 'OK'.

    - Press 'Proprieties' and check 'Reset on Move' and 'Reset on Rotate'.

    - Now press 'Script...' and paste this:




    objectHand, recordHand, wallHand : HANDLE;

    objectName : STRING;

    X, Y : REAL;


    IF GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand) THEN BEGIN {Get Object info}

    SetObjectVariableBoolean (objectHand,800,TRUE); {Let the text style be changed by the user from outside}

    GetSymLoc(objectHand, X, Y); {Get Object Position}


    Lous(0,0); {Something to see, won't print}

    TextOrigin (0,0); {Set text position, note the object internal coordinate system)}

    FillPat(0); {Set Fill to None}


    Concat('(',Num2StrF(X),')(',Num2StrF(Y),')' ) {Note there is no ; at the end of this line}



    RUN (XYText);

    Then you have to add it to your workspace (File > Workspace Editor), choose 'Edit a copy' and at the 'Tool' tab you'll find it under the 'Miscellaneus' category.

    [ 06-07-2005, 10:01 AM: Message edited by: Alexandre B A Villares ]

  10. It took me years to perfect this code:


        {******* non-scaling PIO code starts here ***************}


    IF GetCustomObjectInfo(objectName, objectHand, recordHand, wallHand)

    & GetLayer(objectHand)<>NIL THEN Layer(GetLName(GetLayer(objectHand)));



    { Your code will go here, this poly is an example }


    Poly( -5*mm,1*mm,





    {this temp. active layer change is necessary to avoid text size problems if the PIO

    is redrawn when not in the active layer, and the active layer has a different scale}


    [ 05-15-2005, 09:29 PM: Message edited by: Alexandre B A Villares ]

  11. You should test for IsObjectFlipped() otherwise you get strange behavior if the user uses the mirror tool on your PIO.


    {--- some old code chunk I've found as example----}



    IF (LRot >#90d) THEN f:=-f;

    IF (LRot <-#90d) AND (LRot >(-#180d)) THEN f:=-f;

    IF PFLIP THEN f:=-f;

    IF f=1 THEN TextJust(1) ELSE TextJust(3);

    Ltexto:= PLineOffset*mm;


    IF IsObjectFlipped(objectHand) THEN BEGIN LRot:=-LRot; f2:=-f2; END;













    RotatePoint(PLineLength,0, -LRot);

  12. Hi,

    I'm not sure this is relevant in this case... but as I've done some 'scale independent' PIOs I noticed that on special ocasions they can regenerate while not being at the active layer, making the text size go wrong.

    So I have added some code before and after the drawing procedures that make the parent layer (if found) temporarily active.



  13. I?ve created a resource file with the images I want on ResEdit on the Mac and it works OK on my dialog script on the Mac, but it is not working on the PC.

    I?ve tried to isolate the resource fork part of the file and I have renamed the extension .rsr for the PC. Please Help!

    I?ve tried to get the resource fork from a networked PC HardDisk, and also tried emailing it and dowloanding at the PC. Tried a USB pendrive also.

    None of my Macs have floppy disks anymore so I wasn?t able to do the ancient drill of saving it on a PC formated disk.

    Very frustrating!

  14. quote:

    Originally posted by ccroft:

    Do you get the same type of thing if the angle is other than zero?

    Hi Charles,

    Yes, any angle.

    I have to test it again on VW11, now on VW10 for some reason the code posted produces an ungrouped Tapered Extrude, 6 NURBs surfaces! It's driving me crazy!

  15. Hi kiwi,

    Maybe my wording was not very clear (I have even edited the post now). Tapered Extrude is plan/view independent You have to rotate it afterwards if you want it sideways.

    The document is set to meters and I put 'm' after the 100 real-type paramenter...

    It looks like a bug to me.

    [ 02-07-2005, 06:11 PM: Message edited by: Alexandre B A Villares ]

  • Create New...