Jump to content

Paolo

Member
  • Posts

    182
  • Joined

  • Last visited

Posts posted by Paolo

  1. Yes, of course, these are the only two obligatory and undeletable classes, always present in any VW document.

    You cannot even change their names, though you can change graphic attributes.

  2. Is there a programatical way to get the "none" class name?

    This is useful for plugin localization. In italian "none" become "nessuna" and so on for other languages. Is it possible that this special class (it is always present and you cannot delete it!) has not a VectorScript instruction for retrieving its localized name?

    Thank you for your help,

    Paolo

  3. I have made, some time ago, a plugin that fits your needs. It can create parametric niches or openings with splays (also aymmetric) and vault of various kinds.

    I can't attach the plug in directly here. Let me know how to send it to you.

    Ciao,

  4. I have written a program that reads VectorWorks log and extract from that a "text only" file (with Tab Separated fields) to be used in databases / worksheet for statistics, billings etc..

    The record fields are:

    date: MM/DD/YYYY HH:MM

    drawing: file name

    time: HH:MM

    The program (I called it logex) is working fine with my VW11 version and is localized for English and Italian (my native language), but, while testing on VW12 logs, (thanks to VectorDepot), we discovered a bug in the report produced by that version.

    The problems is in the Saved as lines.

    VW11 produces a report like this:

    1/6/2006 4:59 PM Opened "file1".
    1/6/2006 4:59 PM Saved "file1" as "file2".
    1/6/2006 4:59 PM Closed "file2".

    Unfortunately the same in VW12 appears as:

    1/6/2006 4:59 PM Opened "file1".
    1/6/2006 4:59 PM Saved "file2" as "file2".
    1/6/2006 4:59 PM Closed "file2".

    Note that the name at left is the same as the one at right (the new name!). There is no chance for my program to recognize what is the name of the file you was saving as.

    Is there anyone that can confirm this bug? I'd like to know if it happens only with VW12 or the problem is already present in VW11.5. Previous version (I am user since 8.5 to 11) had not such a problem.

    Is there anyone at Nemetschek aware of this?

    Thank you for helping.

    This program should be published soon on Vector Depot

  5. I'm searching a way to retrieve points of location and target from a whatsoever view, but there is not the GetViewVector() VectorScript function (that'll be what I need!).

    This is useful to me because rendering programs I use such Artlantis or Piranesi make the camera-target coordinates as their numerical perspective setting.

    It is easy to transport the camera and target coordinates from Artlantis to VectorWorks and, by a script which use the SetViewVector() function, recreate the very same shot, but I am not able to do the inverse.

    I've tried to find a relation between GetView(), SetView() and SetViewVector(), until now with no result.

    Is there someone who can explain me what relation there is between these view functions? [Confused]

  6. Hi Hong,

    One simple script to merge blocks is the following:

    code:

    procedure mergetext;

    const

    CR = chr(13);

    var

    texthandle : handle;

    list : handle;

    counter : integer;

    FUNCTION merge_text(h:HANDLE):BOOLEAN;

    begin

    if counter = 1 then

    texthandle := h

    else

    begin

    SetText(texthandle,concat(GetText(texthandle),CR,GetText(h)));

    delobject(h);

    end;

    counter := counter+1;

    merge_text := false;

    end;

    begin

    texthandle := NIL;

    counter := 1;

    {cycle through selected objects}

    ForEachObjectInList(merge_text,2,1, list);

    end;

    run(mergetext);
    [/code]

    In simple words, select the text blocks you want to merge, then launch this script.

    It should copy the content of each text block into the first of the list deleting the no more needed blocks.

    Note 1. The order (in the stack of objects) in the DWG you converted may be reversed, so if your final text results upside-downed, simply exchange the two members in the concatenation expression.

    Note 2. The constant CR (carriage return) is set to chr(13) for the Mac side of the world. If you are a Window user, you should use something like chr(10)+chr(13) to get the carriage return.

    If you want no carriage return at all, simply set CR to ' ' (one space) or '' (nothing).

    Hope this helps you,

    bye

  7. Hi Hong,

    I made a script that creates a new class (naming it with a prefix and a suffix composed by line color and fill color indexes) each time a new pair pen/fill is found in the selected objects.

    This is useful to me to convert line-coloured 3D models (often DXFs) you find around the web and you want them to be coloured by class.

    Hoping this is useful, here's the code

    Paolo

    code:

     

    procedure col2class;

    {this procedure is to convert selected objects to a new class with prefix-indexcolor naming}

    {a class is created each time a new couple pen/fill is found}

    var

    prefix : string;

    mylist : handle;

    warn : boolean;

    tipo : integer;

    FUNCTION cambia(h:HANDLE):BOOLEAN;

    label 100;

    var

    r,g,b : longint;

    r1,g1,b1: longint;

    newclass: string;

    suffix : string;

    indice : integer;

    indice1 : integer;

    i : integer;

    BEGIN

    tipo := getType(h);

    {the script works only with 2d or 3d objects (650 and 651 selectors, see on-line manual appendix)}

    if (GetObjectVariableBoolean (h,651) or GetObjectVariableBoolean (h,650)) and (tipo<>11) and (tipo <> 15) then

    begin

    GetFillBack(h,r,g,b);

    GetPenFore(h,r1,g1,b1);

    RGBToColorIndex(r,g,b,indice);

    RGBToColorIndex(r1,g1,b1,indice);

    suffix := concat ('-', indice,'-',indice1);

    newclass := concat(prefix, suffix);

    {check if the class newclass already exists}

    i := 1;

    while (classlist(i) <> newclass) and (i < classnum) do

    begin

    i := i+1;

    end;

    if classlist(i) = newclass then

    {exit from while as soon as you find newclass exists}

    begin

    goto 100;

    sysbeep;

    end;

    if i = classnum then

    {exit from while at the end of classlist (without any newclass found)}

    begin

    nameclass(newclass);

    {attributes of selected object}

    GetFillBack(h,r,g,b);

    SetClFillBack(newclass, r,g,b);

    GetFillFore(h,r,g,b);

    SetClFillFore(newclass, r,g,b);

    GetPenBack(h,r,g,b);

    SetClPenBack(newclass, r,g,b);

    GetPenFore(h,r,g,b);

    SetClPenFore(newclass, r,g,b);

    if not GetObjectVariableBoolean (h,650) then {restricted to 2d obj, LW and LS gives error if the object is a 3D one}

    begin

    SetClLW(newclass,GetLW(h));

    SetClLS(newclass,GetLS(h));

    end;

    goto 100;

    end;

    100:begin

    SetClass(h, newclass);

    {set class attributes}

    SetClUseGraphic(newclass, true);

    SetFillColorByClass(h);

    SetFPatByClass(h);

    SetLSByClass(h);

    SetLWByClass(h);

    SetMarkerByClass(h);

    SetPenColorByClass(h);

    end;

    end else

    if tipo = 15 then warn := true;

    END; {function}

    begin {main}

    warn := false;

    {ask prefix}

    prefix := StrDialog('Digit the class prefix','');

    if prefix <> '' then

    begin

    ForEachObjectInList(cambia,2,1,myList);

    if warn then

    begin

    sysbeep;

    alrtDialog(concat('Some of selected objects is invalid. (type ',Num2Str(0,tipo),')'));

    end;

    end;

    end;

    run(col2class);
    [/code]

  8. Is there anybody here who have used the procedure

    code:

    CreateLoftSurfaces(groupCurvesHd:HANDLE; bRule:BOOLEAN; bClose:BOOLEAN; bSolid:BOOLEAN):HANDLE;  [/code][/indent]

    What is the groupCurvesHd parameter? I have two nurbs each in one handle (h1 and h2). How can I pass them to the above procedure?

    The VectorScript manual provides no example for this.

    Thank you in advance.

    Paolo
  9. Thank you Raymond, I solved the problem also using matrices. Thanks to Dr. Math

    http://mathforum.org/dr.math/

    Description:

    Given a vector and the three rotation angles (on x, y, z), the result is a new vector corresponding to the first vector rotated.

    The resulting function is as follows:

    code:

      

    function Vec3DRot(v1:Vector;xRot,yRot,zRot:real):vector;

    var

    m : array[1..3,1..3] of real; {matrice of transformation}

    c,s : real; {cosine and sine variables}

    vt,v2 : vector; {temporary vectors used in calculations}

    begin

    vt := v1;

    {********** X rotation **********}

    c := cos(deg2rad(xRot));

    s := sin(deg2rad(xRot));

    m[1,1] := 1; m[2,1] := 0; m[3,1] := 0;

    m[1,2] := 0; m[2,2] := c; m[3,2] :=-s;

    m[1,3] := 0; m[2,3] := s; m[3,3] := c;

    {rotation}

    v2.x := vt.x * m[1,1] + vt.y * m[2,1] + vt.z * m[3,1];

    v2.y := vt.x * m[1,2] + vt.y * m[2,2] + vt.z * m[3,2];

    v2.z := vt.x * m[1,3] + vt.y * m[2,3] + vt.z * m[3,3];

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

    vt := v2;

    {********** Y rotation **********}

    c := cos(deg2rad(yRot));

    s := sin(deg2rad(yRot));

    m[1,1] := c; m[2,1] := 0; m[3,1] := s;

    m[1,2] := 0; m[2,2] := 1; m[3,2] := 0;

    m[1,3] :=-s; m[2,3] := 0; m[3,3] := c;

    {rotation}

    v2.x := vt.x * m[1,1] + vt.y * m[2,1] + vt.z * m[3,1];

    v2.y := vt.x * m[1,2] + vt.y * m[2,2] + vt.z * m[3,2];

    v2.z := vt.x * m[1,3] + vt.y * m[2,3] + vt.z * m[3,3];

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

    vt := v2;

    {********** Z rotation **********}

    c := cos(deg2rad(zRot));

    s := sin(deg2rad(zRot));

    m[1,1] := c; m[2,1] :=-s; m[3,1] := 0;

    m[1,2] := s; m[2,2] := c; m[3,2] := 0;

    m[1,3] := 0; m[2,3] := 0; m[3,3] := 1;

    {rotation}

    v2.x := vt.x * m[1,1] + vt.y * m[2,1] + vt.z * m[3,1];

    v2.y := vt.x * m[1,2] + vt.y * m[2,2] + vt.z * m[3,2];

    v2.z := vt.x * m[1,3] + vt.y * m[2,3] + vt.z * m[3,3];

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

    Vec3DRot := v2; {the resulting vector}

    end;
    [/code]

  10. I'm using vector data type for my studies on a 3D tree generation tool I already published, as a first release, at www.VectorDepot.com, plugins section.

    What I need is a function to rotate vectors in 3D space (same as the Rotate3D for 3D objects).

    Example:

    code:

    Function Vec3DRot(v: Vector; XRot, YRot, ZRot: Real):Vector;

    [/code]

    I do not know if VW10 has something like this on the vector data type function set, I'm using VW9.5 that has a poor set of functions about vectors.

    Thank you in advance for help. [smile]

  11. I'm working on a plugin that makes possible to put dimensions on ISO Views. Let us say I've done it, the result is a group composed by a dimension line with the exact measure, bracketed in angled lines according to the ISO view. The problem is that the behavior of this group is far from that of common dimensions, in a few words, it is no more editable.

    What I'm searching is the code source of dimensions plugin (if it exists) to make possible my dimension to be dragged, resized and recalculated.

    For whom interested on ISO View dimension script, write to me at project@arcoarredamenti.it

    Paolo

  12. Is there a way to create via VectorScript a database on the fly (if it is not already in the document) or, as a second chance, import it from a template document.

    The first solution is available with WorkSheets (CreateWS), the second is available for Symbols (CopySymbol). I've not found nothing similar for Databases.

    Can someone help me? Thanks!

    [Confused]

  13. Suppose to insert two adjacent symbols (or parametric objects, e.g. 2 doors) in a wall (note, adjacent means that the second object left side starts from the first object rigth side). Doing this you expect should be no wall between the two objects, instead, in 3D mode, you'll see a zero thick (3D polygon) part of the wall. This happens even if you overlap the two objects.

    It seems that an object in a wall takes with him a frame of 3D polygons all around its perimeter.

    The question is: there is a way to get rid of this frame?

  14. Is there in the web a place where we can upload/download our vectorworks creations (plugins, sources, symbols, 3D models etc.)?I have made some useful plugin and I'd like to share it, for free, of course!

    Paolo - Italy cool.gif" border="0

  15. quote:

    Originally posted by Alexandre B A Villares:
    That is a very good question indeed!

    If I uderstand it correctly:

    Is it possible to change the value-list of a PIO pop-up parameter from inside it?

    Note: To chage a parameter's value is easy, what Paolo wants is to change the options that will appear on the pop-up at the Obj. Info Palette...

    rgds,Alexandre

    -Yes, it is so, let's have, for example, a parametric chair in which legs material have a pop-up menu class where we may choice from one of the classes available on the drawing.

    ciao,Paolo

  16. Is it possible to dinamically change a custom object menu displaying all available classes in the document?

    The goal is to have specific plugin elements with classes choosen from the standard document list (not style-1, style-2, style-n prepared in the usual way in plugin parameters editor).I've tried to set the list in the menu at object creation (IsNewCustomObject), but when I attempt to change menu parameter values with SetRField (in a FOR cycle passing a class string at each loop), the result is the insertion of only the last value passed, not the entire list.

    I fear this is not possible as I have never seen, till now, a plugin with such behaviour, but I'll be glad to be contradicted. smile.gif" border="0

  17. Hello, I'm Paolo from Italy,

    Using VW9 I realized that boolean operations between solids are a long way worse than VW8.5.The evidence jump to eyes using boolean subtraction when one of the solids involved contains round parts (ovals or round rect) and is obtained by multiple extrusion.

    Perform the following test in VW8.5 and VW9.0-------------------procedure test;varbody, hole, edge, difference : HANDLE;result : INTEGER;chrono : LONGINT;

    beginchrono := GetTickCount;beginXtrd(0,10); RRECT(-20,20,20,-20,14,14);endXtrd;body := LNewObj;Move3DObj(body,0,0,-1);

    beginXtrd(2,10); RRECT(-18,18,18,-18,12,12);endXtrd;hole := LNewObj;

    beginMXtrd(2,0); RRECT(-18,18,18,-18,12,12); RRECT(-16,16,16,-16,10,10);endMXtrd;edge := LNewObj;

    result := SubtractSolid(body, hole, difference);result := SubtractSolid(difference, edge, difference);

    chrono := GetTickCount-chrono;message(chrono,' /60 equivalent to ', chrono/60, 'seconds');end;

    run (test); -----------------

    test results on my computer are:with VW8.5: 6/60 equivalent to 0.1 secondswith VW 9 : 970/60 equivalent to 16.16 seconds!!!

    The test has been performed on a PowerMac G4 533 MHz, 384Mb phisical RAM, 576Mb virtual RAM122.880 Kb memory assigned to VW8.5160.000 Kb memory assigned to VW9

    Both programs have 3D conversion resolution set to minimal in the general preference panel. (Obviously higher 3D resolution means test time increasing).

    I'll be glad to know why in VW9 this simple operation is incredibly slower.Please, let me know if the test has similar results on your machines and help me to find out a way out. Thanks

    --

    ARCO ARREDAMENTI srl55049 VIAREGGIO (LU) - ITALY - Via Aurelia Nord, 102tel. +39 0584 46465 - fax +39 0584 46466internet: http://www.arcoarredamenti.it - e-mail: info@arcoarredamenti.it

    confused.gif" border="0

×
×
  • Create New...