Jump to content

Paolo

Member
  • Content Count

    69
  • Joined

  • Last visited

Everything posted by Paolo

  1. I would like to share my saved workspace (VW 11, Mac OsX 10.3) with my colleague (VW11, Windows Xp), but giving him a copy of my .vww file and putting it in his workspace folder, does not work. Is there any suggestion? Thank in advance for your help.
  2. 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
  3. 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]
  4. Thank you very much for your information. I wonder why do not mention this simple information in the VectorScript function reference... Paolo
  5. 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
  6. By the way, for whom interested in 3d tree vectorscript tool, I made a mistake on the vectordepot link. Follow this link: http://www.VectorDepot.com/PlugIns1.shtml I'm working on a new, faster and more natural version. Next to come. Ciao
  7. 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]
  8. The order of rotation MUST respect the VW convention of XYZ order and because vectors are substantially 3D points (the vector starts from 0,0,0 and goes to that point), the rotation has to have the origin (0,0,0) as pivot.
  9. 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.
  10. 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
  11. 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!
  12. 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?
  13. thanks Francesco, i'll go and watch it bye
  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
  15. Paolo

    Classes in PIO's

    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.
  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
  18. Hello, I'm Paolo from Italy, Using VW9 I realized that boolean operations between solids are very much 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 Paolo Marcuccetti -- 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
  19. I'm trying to do a script that starting for a selected polygon, given a step parameter, a bevel ray and an extrusion value, create a 3D object corresponding at the original polygon extruded beveled with the corrisponding ray. The idea is to use the tapered extrusion for each step, changing the height and the angle values. I've started this project but I found some obstacles to go on. Is anybody interested in a collaboration to realize this? If yes, contact me to share ideas and code. Thank you.

 

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.

×
×
  • Create New...