Jump to content

Paolo

Member
  • Content Count

    61
  • Joined

  • Last visited

Posts posted by Paolo


  1. Hello,

    On request, I have prepared a quick video showing the usage of some of the parametric objects included in the Mouldings Plugins for Vectorworks 2019.

    The video is on YouTube and on the site: https://fitplot.it/vwplugins/mouldings.html

     

     

     

     

    Recap of what Mouldings plugins can do:

    The plugins set consists of 3 PIO (Moulding on 2D path, Moulding on 3D path, Frame) and 3 tools (2D path -> Moulding, NURBS -> Moulding 3D and Profile->File.cpf to create your own profiles to be used with the PIO).

     

    • Updated for VW2019

    • More than 500 profiles subdivided in 12 categories

    1411035376_Schermata2019-02-05alle15_41_00.thumb.png.8a8e77cf84e288d7b33a9ce222467616.png904978321_Schermata2019-02-05alle15_41_07.thumb.png.a0a2810322f68caa4c4074fa8123d168.png

    • Best control on PIO parameters for an accurate customisation

    1379644857_Schermata2019-02-05alle15_42_01.thumb.png.d7922ea45611ff516a13ade2ee82526c.png705065161_Schermata2019-02-05alle15_41_48.thumb.png.059a18c472c1ab57d8335ec23640c040.png894608902_Schermata2019-02-05alle15_42_14.thumb.png.143119203f8b4aaaa8a84a43609a2962.png

     

     

    • Like 4

  2. I am happy to announce that my plugin set to create and manage mouldings is available, on request, for Vectorworks 2019.

    Please, if interested, contact me by the form on the plugin page here:

     

    https://fitplot.it/vwplugins/mouldings.html

     

    1989287804_Schermata2019-01-24alle17_05_36.thumb.png.2135c7fc257b6ea79d64a3c099bfb55b.png

    Recap:

    The plugins set consists of 3 PIO (Moulding on 2D path, Moulding on 3D path, Frame) and 3 tools (2D path -> Moulding, NURBS -> Moulding 3D and Profile->File.cpf to create your own profiles to be used with the PIO).

     

    • Updated for VW2019

    • More than 500 profiles subdivided in 12 categories

    1411035376_Schermata2019-02-05alle15_41_00.thumb.png.8a8e77cf84e288d7b33a9ce222467616.png904978321_Schermata2019-02-05alle15_41_07.thumb.png.a0a2810322f68caa4c4074fa8123d168.png

    • Best control on PIO parameters for an accurate customisation

    1379644857_Schermata2019-02-05alle15_42_01.thumb.png.d7922ea45611ff516a13ade2ee82526c.png705065161_Schermata2019-02-05alle15_41_48.thumb.png.059a18c472c1ab57d8335ec23640c040.png894608902_Schermata2019-02-05alle15_42_14.thumb.png.143119203f8b4aaaa8a84a43609a2962.png

     

     

    • Like 3

  3. Solved!

     

    Julian code needed only some retouch, the idea was right!

    The correct procedure (at least it works for my purposes) is as follows:

    …
    resultStatus := GetCustomObjectInfo(parmName, parmHand, parmRecordHand, wallHand);
    	
    	IF (resultStatus = TRUE) AND (parmHand <> NIL) AND (parmRecordHand <> NIL) THEN BEGIN
    	
    	if GetObject(PFILESCELTO) <> NIL then 
    	begin
    		symbol(PFILESCELTO, 0, 0, 0);
    		h1 := LNewObj;
    		h2 := GetCustomObjectProfileGroup(parmHand);
    		IF h2 <> Nil THEN DelObject(h2);
    		result := SetCustomObjectProfileGroup(parmHand, h1);
    	end;
    …

    In this way the symbol is not visible in the PIO representation, but is embedded and thus, copy / paste, of the object will include the symbol itself.


  4. Thank you,

    I have tried in the reset event (I am in an event driven plugin), but the symbol appears on the drawing…

     

    this is my code, PFILESCELTO is the symbol name, I have to check if it is on the drawing

    …
        parmName := 'BAD';
        parmHand := nil;
        parmRecordHand := nil;
        wallHand := nil;
        primoPassaggio := TRUE;
        
        resultStatus := GetCustomObjectInfo(parmName, parmHand, parmRecordHand, wallHand);
        
        IF (resultStatus = TRUE) AND (parmHand <> NIL) AND (parmRecordHand <> NIL) THEN BEGIN
        
        if GetObject(PFILESCELTO) <> NIL then 
        begin
            symbol(PFILESCELTO, 0, 0, 0);
            h1 := LNewObj;
            h2 := GetCustomObjectProfileGroup(parmHand);
            IF h2 <> Nil THEN DelObject(h2);
            IF h1 = NIL THEN result := SetCustomObjectProfileGroup(parmHand, h2);
        end;
    …

     


  5. Hello experts,
    I have developed a plugin object that takes advantage of a particular symbol to get from it the polyline it contains.
    If I copy / paste this object on another drawing, the symbol is not copied, because it is not actually drawn in the object, it is just used to get the polyline.
    Is there a way to embed the symbol inside the object without the need to draw it?

    Thank you for any help.


  6. Here's the script with the var passed as reference.

    It works only when you apply the trick

    s:=concat('', s);

    The result is a list of valid real numbers delimited by spaces, to be splitter later:

    35.938 135.145 36.233 140.511 36.971 140.511 36.971 135.145 145

     

    I'll try to port these in python. I do not know python, while I am an old Vectorscript developer.

    I hope python has a better array management (count, split etc.) as any modern language should.

    procedure trim;
    const
    testString = '<polygon  points="35.938,135.145 36.233,140.511     36.971,140.511 36.971,135.145     "/>';
    var
    r: dynarray[]of char;
    procedure trimNotInList(list: DYNARRAY[] OF CHAR; VAR s: dynarray[]of char);
    VAR
        i : INTEGER;
        t : dynarray[]of char;
    BEGIN
        t := s;
        i := 1;
        WHILE i <= Len(t) DO
            IF (Pos(Copy(t, i, 1), list) = 0) THEN
                Delete(t, i, 1)
            ELSE
                i := i + 1;
        s := t;
    END;
    procedure runOfSpacesIntoOne(var s:dynarray[]of char);
    var
    i:integer;
    temp: dynarray[] of char;
    begin
    s := Concat('',s); {pseudo reset}
    temp := '';
    for i:=1 to len(s) do
    begin
    temp:=concat(temp, s[i]);
    if (i>1) then
        if (s[i]=' ') and (s[i-1]=' ') then 
            temp := copy(temp, 1, len(temp)-1);
    end;
    s := temp;
    end;
    procedure trimSpaces(var s:dynarray[] of char);
    var
    i, ti, te:integer;
    begin
    s := Concat('',s); {pseudo reset}
        for i:=1 to len(s) do
        begin
            ti :=i;
            if s[i] <> ' ' then i := len(s); {esco dal for}
        end;
        for i:=len(s) downto 1 do
        begin
            te := i;
            if s[i] <> ' ' then i := 1; {esco dal for}
        end;
    s := copy(s, ti, te-ti+1);
    end;
    procedure replaceCommas(var s: dynarray[]of char);
    var
    i:integer;
    temp: string;
    begin
    s := Concat('',s); {pseudo reset}
    temp := '';
    for i:=1 to len(s) do
    begin
    if s[i] = ',' then temp:=Concat(temp,' ')
        else if s[i] = '-' then temp:=Concat(temp,' -')
        else temp:=Concat(temp,s[i])
    end;
    s := temp;
    end;
    {*********************** scanPolyPoints **********************}
    {return the substring between 'points="' and '"', I'll split these points later}
    procedure scanPolyPoints(parameter: string; line: DYNARRAY[] OF CHAR; var r:DYNARRAY[] OF CHAR);
    var
    index1, index2: integer;
    temp: DYNARRAY[] OF CHAR;
    begin
    index1 := Pos(parameter, line)+1+len(parameter);
    temp := copy(line, index1, len(line)-index1);
    index2 := Pos('"', temp);
    temp := copy(temp, 1, index2-1);
    temp := concat('', temp);
    trimNotInList('0123456789+-,. ',temp);
    replaceCommas(temp);
    runOfSpacesIntoOne(temp);
    r := temp; 
    trimSpaces(r);
    end;
    
    begin
    r:=teststring;
    scanPolyPoints(' points=', teststring, r);
    writeln(r);
    end;
    run(trim);

     


  7. I am trying to develop an SVG reader in Vectorscript, but I am at a stake because of the impossibility to manage functions or procedures that calculate and return strings that may have more than 255 chars.
    Having to do with SVG commands like this…

    <path fill="none" stroke="#000000" stroke-width="0.238" stroke-linecap="round" stroke-linejoin="round" stroke-miterlimit="10" stroke-dasharray="1,1" d="
        M47.506,645.356c0.099,0,0.197-0.049,0.296-0.049c0.098,0,0.196-0.05,0.295-0.099s0.197-0.049,0.296-0.099
        c0.098-0.049,0.196-0.099,0.246-0.147c0.098-0.049,0.196-0.099,0.246-0.147c0.098-0.05,0.147-0.099,0.246-0.148
        c0.099-0.049,0.147-0.147,0.246-0.196c0.049-0.05,0.147-0.148,0.196-0.197c0.05-0.049,0.148-0.147,0.197-0.246
        s0.099-0.147,0.197-0.246c0.049-0.099,0.098-0.147,0.147-0.246c0.049-0.099,0.099-0.197,0.147-0.295
        c0.05-0.148,0.147-0.296,0.197-0.493c0.049-0.147,0.099-0.295,0.196-0.492c0.05-0.147,0.099-0.345,0.148-0.492
        c0.049-0.196,0.147-0.442,0.196-0.64c0-0.05,0.05-0.147,0.05-0.197c0-0.049,0.049-0.147,0.049-0.197
        c0-0.049,0.05-0.147,0.05-0.196c0-0.05,0.049-0.147,0.049-0.197c0-0.049,0-0.049,0-0.099c0-0.049,0-0.049,0-0.098
        c0-0.05,0-0.05,0-0.099c0-0.05,0-0.05-0.049-0.099c0-0.049-0.05-0.049-0.05-0.049l-0.049-0.05l-0.05-0.049
        c-0.049,0-0.049-0.05-0.099-0.05c-0.049,0-0.049,0-0.098,0c-0.05,0-0.05,0-0.099,0c-0.05,0-0.05,0-0.099,0s-0.049,0-0.099,0.05
        c-0.049,0-0.049,0.049-0.099,0.049l-0.049,0.05l-0.049,0.049c0,0-0.05,0.049-0.05,0.099c0,0.049-0.049,0.099-0.049,0.147
        s-0.05,0.099-0.05,0.147c0,0.05-0.049,0.099-0.049,0.148c0,0.049-0.049,0.098-0.049,0.147c-0.05,0.099-0.099,0.246-0.197,0.345
        c-0.05,0.099-0.099,0.246-0.197,0.345c-0.099,0.147-0.147,0.246-0.246,0.394s-0.147,0.246-0.246,0.394s-0.197,0.246-0.246,0.345
        s-0.147,0.147-0.197,0.246c-0.049,0.099-0.147,0.147-0.196,0.197c-0.05,0.049-0.147,0.147-0.197,0.196
        c-0.049,0.05-0.147,0.148-0.246,0.197s-0.147,0.099-0.246,0.147c-0.099,0.05-0.147,0.099-0.246,0.148
        c-0.099,0.049-0.197,0.098-0.246,0.147c-0.099,0.049-0.197,0.099-0.296,0.147c-0.147,0.049-0.295,0.099-0.442,0.147
        c-0.147,0.05-0.296,0.099-0.443,0.148c-0.147,0.049-0.295,0.098-0.443,0.147c-0.098,0.049-0.196,0.049-0.295,0.099
        c-0.099,0-0.197,0.049-0.296,0.049c-0.049,0-0.147,0.049-0.196,0.049c-0.05,0-0.147,0-0.197,0.05c-0.049,0-0.147,0-0.196,0.049
        c-0.05,0-0.148,0-0.197,0.05c-0.05,0-0.05,0-0.099,0s-0.049,0-0.099,0.049c-0.049,0-0.049,0.049-0.049,0.049l-0.05,0.05
        l-0.049,0.049c0,0.05-0.049,0.05-0.049,0.099s0,0.049,0,0.099c0,0.049,0,0.049,0,0.099c0,0.049,0,0.049,0,0.098
        c0,0.05,0,0.05,0.049,0.099c0,0.05,0.049,0.05,0.049,0.099l0.05,0.049l0.049,0.05c0,0,0.05,0.049,0.099,0.049s0.049,0,0.099,0.05
        c0.049,0,0.049,0,0.099,0c0.049,0,0.099,0,0.147,0s0.099,0,0.147,0c0.05,0,0.099,0,0.147,0c0.05,0,0.099,0,0.148,0
        c0.147,0,0.295,0,0.442,0c0.148,0,0.296,0,0.443,0s0.345,0,0.492-0.05c0.147,0,0.345-0.049,0.492-0.049
        C47.161,645.406,47.359,645.406,47.506,645.356z”/>

    … that goes very beyond the 255 chars strings limit, I had necessarily to substitute functions returning strings into functions returning dynarray[]of char, but this is FORBIDDEN.
    So I tried with procedures returning dynarray[]of char as VAR (this is allowed) but I found strange behaviors.

     

    For example, the following script takes the constant string (this is a short string, just for instance).
    The first procedure extracts the substring starting from 'points="' and the subsequent '"'.
    The second procedure replaces the commas with spaces.
    Both procedure uses the same VAR s:string declared.

    procedure test;
    const
    polygon = '<polygon  points="35.938,135.145 36.233,140.511     36.971,140.511 36.971,135.145     "/>’; 
    {this is just an example of SVG line, this is < 256 chars, but this is a special case}
        
    var
    s: dynarray[]of char; {declare the VAR I'll use later as value returned from procedures}
        
    {*********************** scanPolyPoints **********************}
    {return the substring between 'points="' and '"', I'll split these points later}
    procedure scanPolyPoints(parameter: string; line: DYNARRAY[] OF CHAR; var r:DYNARRAY[] OF CHAR);
    var
    index1, index2: integer;
    temp: DYNARRAY[] OF CHAR;
    begin
    {search the position of 'parameter='}
    index1 := Pos(parameter, line)+1+len(parameter);
    temp := copy(line, index1, len(line)-index1); {remaining string} 
    {search the position of '"' in the remaining string}
    index2 := Pos('"', temp);
    temp := copy(temp, 1, index2-1); {here I have only the string composed by points} 
    r := temp; {set the answer r}
    end;
    
    {*********************** replaceCommas **********************}
    {substitute each comma with a space and each minus signs with ' -'}
    {in the SVG (generated by Adobe Illustrator), the path numbers are separated by a ',' or by '-' or by a space}
    {whenever you find a '-', the ',' is omitted!}
    procedure replaceCommas(source:dynarray[]of char; var dest: dynarray[]of char);
    var
    i:integer;
    temp: string;
    begin
    temp := '';
    for i:=1 to len(source) do
    begin
    if source[i] = ',' then temp:=Concat(temp,' ')
        else if source[i] = '-' then temp:=Concat(temp,' -')
        else temp:=Concat(temp,source[i])
    end;
    dest := temp;
    end;
    begin
    s := ''; {init}
    writeln(polygon); {write the input string to the standard output}
    scanPolyPoints(' points=', polygon, s); {first procedure}
    writeln(s); {write the resulting "s" string to the standard output}
    {Now I use the variable s both as parameter and resulting var}
    replaceCommas(s, s); {second procedure, commas should be replaced by spaces}
    writeln(s); {but NO! It's unchanged}
    {test it with a constant string as parameter…}
    replaceCommas('.,.,.,.,.,.,.,', s);
    writeln(s); {…it works!}
    end;
    run(test);    

    The resulting output is the following:

    <polygon  points="35.938,135.145 36.233,140.511             36.971,140.511 36.971,135.145         "/>
    35.938,135.145 36.233,140.511             36.971,140.511 36.971,135.145         
    35.938,135.145 36.233,140.511             36.971,140.511 36.971,135.145         
    . . . . . . . 

    As you can see, the first procedure works (line 2), the second no (line 3 has still commas in place!). While the constant string has the commas removed (line 4).

    Where is the problem and, most of all, is there a solution?

     

    Thank you for any help.

    Paolo Marcuccetti

     


     


  8. I am proud to announce that some of my plugins and scripts  (previously hosted on Vectordepot) are made available for download here:

     

     https://fitplot.it/vwplugins/

     

    These are a few items developed by me (Paolo Marcuccetti) in the past years, updated and working with VW2018.
    I give these softwares free for download and usage, not for distribution.

     

    If you find these softwares useful in your work, please consider a little paypal donation. You'll find instructions on site.
    Contributions will be used to keep the site updated, to bring in new contents and to give any technical assistance.
     

    Paolo Marcuccetti

    • Like 2

  9. The OSx printing system it's hard to override, Apple takes care of its own user interfaces.

    For a quick print, Benson's way is the more straight.

    If your work is organized in (many) sheet layers and not just one design layer, you may find useful to print to PDF, then use a simple app like this:

    http://digilander.libero.it/kiaradot/fitplot

    here you can easily compose all your sheets in the plotter layout (packing tool).

    You can print also a portion of the PDF (if you have a small printer) or get a "mosaic" of the whole drawing (with overlaps).

    It's also easy to resize (rescale) the PDF for different scale needs.


  10. I have tried, but even in VW2011 this still misses.

    In Viewport section, advanced properties, tab attributes, my best options to achieve what I want are:

    separated transversal sections radio button on

    then you have to choose between

    1. using object class attributes

    2. choose from the classes in the popup (Section Style is proposed)

    The 1 uses the same class that in plan view (not right!)

    the 2 uses one class for all (not right too!)

    If there is a way, please post it...


  11. It would be a good thing to have a "section fill" class attribute.

    Currently, in section view, we have two fill choices:

    1. Using section class (one class for different elements)

    2. Using element class (each element has its inherited fill class)

    Fills/hatches in section may differ from fills / hatches in plan views, usually you should have different diagonal hatches, exclusive for each class/material.

    Since options 1 and 2 does not this completely, I have to make this final step by hand, so it would be appreciated to see this feature implemented in a future release...


  12. I need to get the first intersection point (if any) of a polyline with a given line (extended if needed) via VectorScript.

    I have tried to use the Split2DObjectByLine procedure, but it seems not reliable.

    Here's the script. To test it, draw a polyline, then a line, run the script and select first the poly then the line. A point should be placed at their intersection. Not always it works. Sometimes it even crashes VectorWorks :

    procedure lineToPoly;

    VAR

    polyHandle: handle;

    lineHandle: handle;

    punto :Point;

    function intersectionLinePoly(lineH, polyH: Handle): Point;

    VAR

    tmpPolyH, tmpLineH : handle;

    begPt : point;

    endPt: point;

    resultHandle, temp_h: handle;

    BEGIN

    {faccio copia della linea}

    tmpPolyH := CreateDuplicateObject(polyH, NIL);

    tmpLineH := CreateDuplicateObject(lineH, NIL);

    GetSegPt1(tmpLineH, begPt.x, begPt.y);

    HScale2D(tmpLineH, begPt.x, begPt.y, 10,10,false);

    GetSegPt2(tmpLineH, endPt.x, endPt.y);

    Split2DObjectByLine(tmpPolyH, begPt.x, begPt.y, endPt.x, endPt.y, resultHandle);

    IF resultHandle <> NIL THEN BEGIN

    GetPolyPt(resultHandle, getVertNum(resultHandle), intersectionLinePoly.x, intersectionLinePoly.y);

    END;

    delObject(tmpLineH);

    delObject(tmpPolyH);

    END;

    begin

    GetPt(punto.x, punto.y);

    polyHandle:= PickObject(punto.x, punto.y);

    GetPt(punto.x, punto.y);

    lineHandle:= PickObject(punto.x, punto.y);

    punto := intersectionLinePoly(lineHandle, polyHandle);

    if not ((punto.x = 0) and (punto.y = 0)) then locus(punto.x, punto.y);

    end;

    run(lineToPoly);

    Is there a more reliable way to get this?

    Thank you in advance for your help.


  13. I have the same Designjet HP 500PS and the same problem that I solved.

    To get exact A0, A1, A2, A3 I have create my custom equivalent formats including the margins that are (for the HP 500PS) 1.7 cm (top and bottom) and 0.5 cm (left and right).

    For example A3 Horizontal trimmed is 42x29.7 cm, including margins is 43x33.1 cm.

    Doing this way it works.

    Another way is to print to PDF and using a simple layout program like this (Mac only):

    http://digilander.libero.it/kiaradot/fitplot/Contents/Resources/English.lproj/fitPlot%20help/index.htm

    The advantage is that you may print more drawing at once optimizing paper waste and having the margins under control.


  14. Your suggestion has been the key! Thank you!

    Here's a procedure to increase all the extruded object in a selection of a user given value:

    [font:Courier New]procedure increaseExtr;

    {the goal is to increase extruded objects in the selection of a user requested value}

    var

    oggetto:HANDLE;

    increaseValue : REAL;

    FUNCTION increase(h:HANDLE):BOOLEAN;

    var

    height,width,depth:REAL;

    xRot, yRot, zRot:REAL;

    p0X, p0Y, p0Z: REAL;

    p1X, p1Y, p1Z: REAL;

    result, isMirroredXY: BOOLEAN;

    begin

    {check if the obj is an extrusion}

    if (GetType(h) = 24) then

    BEGIN

    result := Get3DOrientation(h, xRot, yRot, zRot, isMirroredXY);

    Get3DCntr(h, p0X, p0Y, p0Z);

    SetRot3D(h, 0,0,0 , 0,0,0);

    {here depth = extrusion value}

    Get3DInfo(h, height,width,depth);

    {I increase the depth}

    Set3DInfo(h, height,width,depth+increaseValue);

    Set3DRot(h, xRot, yRot, zRot , 0,0,0);

    Get3DCntr(h, p1X, p1Y, p1Z);

    {move of the misplacement p0-p1}

    Move3DObj(h, p0X-p1X, p0Y-p1Y, p0Z-p1Z);

    Get3DCntr(h, p1X, p1Y, p1Z);

    END;

    increase := FALSE;

    end;

    begin

    {ask the value to increase}

    increaseValue := RealDialog('Increase extrusions in the selection of this value','10');

    {apply to the selected set of objects}

    ForEachObjectInList(increase, 2, 0, oggetto);

    end;

    run(increaseExtr);[/font]


  15. Go to VectorDepot and browse for a program called Logex.

    logex_thumbnail.png

    Logex reads and analyze the VectorWorks log file extracting from it all saved drawings on which you have spent more than 1 minute.

    A typical output could be this:

    fileX 23/05/2006 20:39 00:33
    fileY 23/05/2006 20:42 00:11
    Untitled 1 23/05/2006 20:42 00:01
    fileZ 23/05/2006 20:42 00:25
    

    Once saved, the output is a text file with each line representing an event (drawing) record.

    The record fields are:

    • the name of file (drawing)
    • the when (date of event)
    • the time spent for that file

    Fields are TAB separated, so the file is ready to be used in a database or in a worksheet for further statistics.

    Logex analyze the integrity of the VectorWorks log and check if there are errors (due to VectorWorks crashes or possible deactivations / activations of report from the VectorWorks general preferences).

    Errors are classified by a color syntax that may be helping for the correction work.

    Presently logex is available only on Mac OSX? 10.3.9 or more, any version of VectorWorks? (version 12 with some limitations due to a known bug in the "saved as?" lines produced in the report). There is no way for Windows users.

    Logex is available in Italian and English localization.

 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×