Jump to content

tom kyler_dup1

Member
  • Posts

    120
  • Joined

  • Last visited

Everything posted by tom kyler_dup1

  1. Ok, here's the script: PROCEDURE GetXYZ; VAR hsymbol :HANDLE; XValue, YValue, ZValue :REAL; BEGIN hsymbol:=FSActLayer; WHILE hsymbol<>NIL DO BEGIN GetSymLoc3D(hsymbol,XValue,YValue,ZValue); SetRField(hsymbol,'XYZData','XValue',num2str(4,XValue)); SetRField(hsymbol,'XYZData','YValue',num2str(4,YValue)); SetRField(hsymbol,'XYZData','ZValue',num2str(4,ZValue)); hsymbol:=NextSObj(hsymbol); END; END; Run(GetXYZ); For the script to work, you have to create a record called "XYZData" and in that record you have to create 3 text fields "XValue" "YValue" and "ZValue". You could set these fields to number, but most import and export formats for 3D programs read text data fine. For the script to work, the symbols you need XY & Z data for need to be selected. When you run the script, all it does is write the XYZ value of the center of the symbol into the record attached to that symbol....and of course the record "XYZData" has to be attached to all these symbols too. Of course you can change the name of the record or the name of the field, or adjust the script to whatever record you may attached to your symbols already. Then if you run a report, you can get all these values into the worksheet and export it. There's some downsides to using the report to get the data into a worksheet, but it's the quickest and easiest. The main problem is that if you have 10 symbols with the same record and you only want 5 of those objects XYZ data, then when you run the report, you'll end up with 10 entries, even though 5 of them may not have XYZ data...but hopefully this will get you in the right direction.
  2. Dario, I know this isn't the questions you're asking, but as an FYI, you can just draw one crown molding profile, then draw a rectangle and select both, then use the "extrude to path" command. Then you will have crown molding that essentially goes around a ceiling. Initially, the crown profile is swept around the rectangle about the middle of the crown profile..and so you have to double click your new 3D crown and opt to edit the profile. When you do, you'll see that the center of the coordinate system represents the rectangle that your crown profile was swept around (or think of it as the corner of ceiling and wall) and you'll have to adjust your crown profile down and to the side a bit. I couldn't say what your problem is, I've repeated your process many times with no problems. There's several things to look for along the way. Try copying your extruded profiles after you've extruded them, and then use them, and do not cut the extrusion from the very end, leave some "leftover" like in woodworking and I believe you'll have better success...maybe use a locus or two lines to help you set your cut line. But if you're doing crown molding, the "extrude to path" is the only way to go.
  3. Well an example script is certainly the best way to learn, if I have time, I'll try to put together an example for you over the weekend. There are a multitude of ways to handle it, but the way I would do it would to be create a record with three fields for X, Y, and Z info. I would then select all the symbols that I wanted X,Y, & Z info for and then run the script. The script would go through all the selected symbols one by one and write the X, Y, and Z values into records attached to all the symbols. Once the X, Y, and Z data is in the database record for each symbol, I would create a worksheet that includes the X,Y, and Z fields. This is an overview of how the script would work, but a sample would explain it better I think. Try the following link for some vectorscript exmaples: http://www.nemetschek.net/support/custom/vscript/example.html Specifically, check out the "intermediate" examples on attaching records to objects. This would be a good start I believe. If I can post some Vectorscript specific to your problem during the weekend, I will.
  4. Peter, It's hard to say what's going wrong with your scripts without knowing your syntax or the error messages, but for list traversal, it helped me to try not to think of the order of items in lists if it's not necessary...but only that you want to do something with a group of objects (that are inherently ordered or listed by Vectorworks) . Most of the lists I traverse, I'm not concerned with their order, only what I want to do to the items in that list. When I first started learning VS, getting a handle on handles (pun intended) was definitely the hardest part. Now you stated that you used the "ForEachObjectInList" Procedure and "gave a handle to FObject as the "List" parameter. Think of objects as pots with no handles, and these pots are full of information (color, size, orientation, etc) and if you want to do something to these pots or change something (attribute) in the pot, you have to attach a handle to it to work with the pot(the object). There are several functions that you can choose to connect to the multiple pots(objects) in your document. FObject will allow you to work with the First object created in your document. FSActLayer allows you to work with the first selected object on the active layer, NextSObj allows you to work with the next selected object in a list (assumes more than one item is selected). ForEachObjectInList applies an action to a list of object (visible objects, selected objects, locked objects, etc) and the "list" is not a parameter you assign a function, but a variable to the first item in the list. The way you would use ForEachObject in list would be as follows: PROCEDURE test; VAR hobject :HANDLE {declares a variable named "hobject" of the HANDLE type} {-------SOME HYPOTHETICAL PROCEDURE THAT DOES SOMETHING TO SELECTED OBJECTS----} PROCEDURE SomeOperation; BEGIN Rotate Object 10 degrees; END; {-------------------------------------------------------------------} BEGIN {Main Program} hobject:=FSActLayer; ForEachObjectInList (SomeOperation,2,0,hobject); END; Run (test); OK, this is conceptual so the above program is schematic, not what you would actually type, but let's say you've selected 5 objects that you want to rotate 10 degrees to the left. The line "hobject:=FSActlayer" will provide a handle (or link) to the first selected object. Now there's some confusion as to whether it's the first object you selected, or whether it's the first object you created that is now selected. Mostly I don't care, since VW keeps track. When you use the "ForEachObjectInList" procedure, VW will look at the "hobject" variable which represents the first selected object (remember "hobject:=FSActLayer) It will then execute the "SomeOperation" procedure on that first object. After that, it will go through each object in the list (selected objects in this case) and execute the "SomeOperation" procedure on each object. Remember that the "list" parameter in this function is a variable name that is assigned to a object using another function. You said you used FObject as the list parameter. This is how FObject would be used in your example VAR hobject :HANDLE; BEGIN hobject:=FObject; ForEachObjectinList(SomeFunction,2,0,hobject); Hope this lengthy explanation helps a bit.
  5. I have a linear plug-in object that draws an object with some text near it. When I select this object and change the font from the main menu, the font doesn't update in real time. I have to deselect the item, change the font, reselect the item and then resize it to get the script to recalculate with the new font. The function I'm unable to find in the reference is one that reads the current active font and allows me to apply it to the selected object...or at least I could use an understanding of what happens to a selected object when the font menu is changed from one font to another. Basically, I want to select my linear plug-in object, go to the font menu, change the font, and have my item updated at that time. Anybody know which function I'm missing? [ 10-08-2004, 04:50 PM: Message edited by: tom kyler ]
  6. If you're looking for an active link that updates XYZ data as you move an object on screen, that isn't going to happen; however, scripting would allow you to select all the items, run the script and have all that data sent to a worksheet in XY & Z columns. You could generate a script that reads the XYZ values all your selected symbols (which would be the center of your symbols) and write that data into records which can then be placed into a worksheet.
  7. Thanks Kev, unfortunately that didn't do the trick, I'm beyond trying to figure it out. I selected all, cut and pasted everything to a new document and the script worked fine. Just shrugged my shoulders and moved on.
  8. Something I'm experiencing that maybe I'm missing. I'm pretty confident in my scripting abilities, and I have a script (see "need challenge" thread) that seemed to work fine. When I import this script into a existing document, it starting doing funny things, in particular, giving me funny coordinates for a 3D vertex. So I created another simple script in this document that simply reads the x,y,& z values of a vertex in a 3D polygon and output that info in the message window. Well consistently, the X value is off by 64.99 units...it doesn't match up with any of the vertex coordinates in the OIP. I'm not sure where this number is coming from. If you import the script into a new document, draw a 3D polygon and run the script, it works fine. I suspect maybe a corrupted file, any other thoughts.
  9. OK, finally got it, here's the final setup: PROCEDURE ReverseVerticies; VAR VertNum, i :INTEGER; VertX, VertY, VertZ :ARRAY[1..50] OF REAL; hobject :HANDLE; BEGIN hobject:=FSActlayer; WHILE hobject<>NIL DO BEGIN Vertnum:=GetVertNum(hobject); For i:=1 to (Vertnum-1) DO BEGIN GetPolyPt3D(hobject,i,VertX,VertY,VertZ); END; For i:=(Vertnum-1) DownTo 1 DO BEGIN SetPolyPt3D(hobject,VertNum-i,VertX,VertY,VertZ); END; hobject:=NextSObj(hobject); END; END; Run(ReverseVerticies);
  10. Well Petri, that didn't work for 3D stuff, but it did make me realize that I need to relocate the points in reverse order, not RENUMBER the verticies in reverse order. Since 99% of the polygons I reverse are quads, I was able to just swap verticies 1 and 3 effectively mirroring the piece. It's a quick fix for now, but the concept would apply to an array for reversing points too. I'll develop that in the near future. Thank you for getting me past my brain freeze. PROCEDURE ReverseVerticies; VAR VertX, VertY, VertZ :ARRAY[1..50] OF REAL; hobject :HANDLE; BEGIN hobject:=FSActlayer; WHILE hobject<>NIL DO BEGIN GetPolyPt3D(hobject,1,VertX[1],VertY[1],VertZ[1]);GetPolyPt3D(hobject,3,VertX[2],VertY[2],VertZ[2]); SetPolyPt3D(hobject,1,VertX[2],VertY[2],VertZ[2]); SetPolyPt3D(hobject,3,VertX[1],VertY[1],VertZ[1]); hobject:=NextSObj(hobject); END; END; Run(ReverseVerticies); [ 10-06-2004, 03:02 PM: Message edited by: tom kyler ]
  11. Thanks Petri, I'll give that a try as my basis. I'll let you know how it works out....and thanks for the synopsis, it's left out of all too many instructional texts.
  12. I could use some insight on this one. I have a 3D polygon with 4 verticies. In a nutshell, I need to reverse the order of the verticies...whereby when you scroll through the verticies in the object info palette (OIP), they've reversed direction, i.e. instead of being clockwise, they'll now be counter clockwise. Now a simple way to handle this is to use the mirror tool on the 3D polygon, but of course I have some non-symmetry situations where that doesn't work. The problem I've run into is I haven't found a function for getting the vertex ID number. There are many functions where you have to specify the vertex number, but I'm missing one that gets the number and allows me to re-order the verticies....and more importantly, a function that allows me to set or renumber the verticies. Any suggestions?
  13. Oops, ignore most of this post, I wrote to the wrong section, but since I'm here, here's my comment...yes, a two-button mouse is the way to go, I've got a dozen scripts set up under my right mouse button that really expedites work-flow.... [ 10-06-2004, 08:03 AM: Message edited by: tom kyler ]
  14. Ron, The way to handle this is to save your fillets and chamfers for last. If you use a chamfer or fillet and want to subsequently edit your model, then you have to 'ungroup' the part to remove the fillet and be able to edit the part. If you have multiple fillet operations, you'll have to ungroup multiple times. The sad part is that there is no history of the fillet after you 'ungroup'. The ungroup essentially removes the fillet. You then have to reapply the fillet as normal after that....so to avoid the issue you're dealing with, I apply the fillets and chamfers last and also save a backup copy of my model without any fillets and chamfers. I [ 09-29-2004, 05:19 PM: Message edited by: tom kyler ]
  15. Ok, quick amendment, it updates...or at least it did this one time, when I resized the OIP window. A quick workaround, but of course would prefer otherwise.
  16. I'm guessing this might be a bug, and maybe been reported before, but I couldn't find anything when searching the site. The problem is when I have the OIP "rolled up" and then select and object and then "unroll" the OIP and it's blank, it just won't update. You can click on other stuff, minimize (mac osx) do all sorts of stuff and still won't update. I have to restart Vectorworks. Anybody have any info on this problem? Fix on the way?
  17. Ziska, this is variation of the method mentioned by Lamberto in the renderworks forum, but a bit more reliable than using sections. I didn't have you exact dimensions so I just made some up. You can see from the plan view that I have different radii for the outside and inside of the treads as well as different radii for each of the supports. I figured this was a worst case (except variable height treads) and would demonstrate the technique adequately. The general idea is to create 3D loci as ?dots? and then connect the dots to give you a nurbs curve to begin your supports. I placed 2D loci at the intersection between supports and treads (see upper right image) and then placed 3D loci on top of the 2D loci. ( I did this because the 3D loci wouldn't snap to the intersection but would snap to a 2D locus) Now the actual intersection between tread and support might not be at the edge of the tread like I've done, but you can make adjustments easily by shifting the treads after the model is created, the important thing being that the vertical distance between tread and support is consistent the entire run of the stairs. Now you should inlcude some extra 3D loci ?extensions? on each end of the run to maintain continuity of the support. Of course the extensions at the beginning of the run would continue below the level of the floor. You can trim the support later. Once I had my 3D loci, I used the 3D move command and moved the loci up 8? at a time. Once all the loci were in place (in 3D space). I used the nurbs tool to connect the dots. So at this point I have two nurbs curved in 3D space. I then go to a orthographic view (front or side) and then duplicate both nurbs curves vertically ...I think I duplicated them 10?. Now you can use the loft tool and loft the top curve to the bottom curve (x2) and you'll have two nurbs surfaces. Then use the shell tool to add some thickness to your supports. I used 1 1/2?. Now when you begin moving your extruded treads up 8? at a time, the'll exactly lie on the support all the way up the supports. Then you can move them up or down to put them ?into? or above the support. At that point, you can trim the top and bottom and you should be pretty close to where you want to be. I added some triangle supports at the bottom just to give them some extra beef. [ 09-19-2004, 02:55 PM: Message edited by: tom kyler ]
  18. Looks like "PrimaryUnits" is the routine to use! Final script is as follows: PROCEDURE FracDec; VAR FracDecStatus :BOOLEAN; BEGIN FracDecStatus:=GetPref(168); IF FracDecStatus=TRUE THEN PrimaryUnits(3,3,5,4,2,TRUE,FALSE) ELSE PrimaryUnits(3,4,5,4,2,TRUE,TRUE); END; Run(FracDec); Slap this under your document context menu and you're good to go [ 09-17-2004, 09:50 AM: Message edited by: tom kyler ]
  19. I did try that and unfortunately had no luck. Specifically, I used the "redrawall" command. In addition, I used the "resetobject" command with a handle to one selected dimension. This did not work either. I think maybe "primaryUnits" might fit the bill and will try that today as time permits. [ 09-17-2004, 09:20 AM: Message edited by: tom kyler ]
  20. I have dimensions onscreen..and I frequently toggle between decimal and fractional formats. I have a script that will toggle the preference back and forth between the two through the document context menu...however, the dimensions already on screen don't update unless they're moved (at which point they update). Any new dimensions created after invoking the script will have the proper format. I would appreciate any input.
  21. How about this? Place 3D loci (in plan view) at each intersection between the support and the stair treads (this does assume similar size "notches" on each tread) and then move them in the Z direction for each step. You can then use the nurbs tool to connect these "3D dots" and form the basis for skinning a nurbs surface and thickening it up with the shell tool. You can then do some 3D subtractions as necessary. [ 09-15-2004, 07:46 PM: Message edited by: tom kyler ]
  22. I would also agree with Andy & Mat. Renderworks will upset you (timewise) the first time you try to rendering a animation. Cinema 4D can have spectacular results and is geared toward texturing, lighting and animation. Of course you have to take the time to learn the tool, there are no "easy" solutions despite the unrealistic expectations of others who desire results without work and knowledge, but if you're going to make regular money doing this kind of work, the investment would certainly be worth it. When I was a student, I had used C4D, Renderworks, Maya, Strata 3D, Form-Z... and the VW to C4D plug-in is the easiest transition between VW and a solid renderer/animator. Like you mentioned, that's a lot of money though and I currently use a $99.00 soluton called 3DTK, a derivative of Electric Image Animation System....BUT, I have to dance through hoops and make all sorts of concessions to get a clean model and I give up a lot in return, including the ability to make quick design changes..... Now that I just thought about it, maybe you should try Artlantis. www.artlantis.com, it's very easy and cheaper than C4D I believe. It uses a plug-in within Vectorworks like C4D to go back and forth between the programs. Check out their gallery. [ 09-15-2004, 09:25 AM: Message edited by: tom kyler ]
  23. Another good thing to try and do is keep the number of points in your source curves to a minimum. When extruding, or sweeping these curves, the number of points will multiply very rapidly. since most 3D shapes are made from a combination of 2D shapes, you can help keep your size down by making these shapes as simple as you can. Since you're dealing with curved shapes, maybe extruded to a path, you can make the cross section of your "tubes" octagonal instead of round. If you don't have a closeup of these shapes, then it won't be that noticeable. If I'm not going to be looking at a curved area close up, then I'll frequently use multi-sided polygons instead of circles. VW doesn't have to calculate as many points for a first-degree curve (straight lines) as for a second-degree curve (curved lines) [ 08-31-2004, 02:14 PM: Message edited by: tom kyler ]
  24. JB, you're not doing anything wrong on this one. It's been discussed on the wish-list forum. I think it's a feature that will make it's way eventually. It is important for alignment I agree. A work-around I use is to place a 3D locus in the center of the circle before extruding and then group the cylinder and 3D locus together. If I want the locus to be at the top of the cylinder, I extrude using a negative value, if you extrude using a postive value, the locus will be at the bottom. Of course you could copy the locus in the Z direction an amount equal to the extrude and have a 3D locus on both ends. It's relatively quick to place the 3D locus so it doesn't bother me too much. Hopefully we'll see that feature in a future release. You will run into another issue though regarding snapping in 3D. It's not fool-proof and Nemetschek is working on this I'm sure. They improved 3D snapping in this latest release, but it still needs some work. If you work in 3D it will be the source of some small frustration. My personal take on this for now is "don't snap in 3D, snap in orthographic views? [ 08-28-2004, 08:37 AM: Message edited by: tom kyler ]
  25. Use the "TEXT">"TRUE TYPE TO POLYLINE" command, once it's a polyline, you can give it a fill and extrude it. [ 08-26-2004, 03:25 PM: Message edited by: tom kyler ]
×
×
  • Create New...