Jump to content

MullinRJ

Member
  • Posts

    2,004
  • Joined

  • Last visited

Everything posted by MullinRJ

  1. It is easy for the user to grasp and use, but it is difficult to implement. It would also slow the render and screen redraw times down a lot. Somewhere along the line, the computer is going to have to apply graduated transparency steps to the objects it draws. The smoother the effect, the more steps, just like the masking operation you were contemplating. Nice wish item, though. Photoshop might be the better tool at the moment. Raymond
  2. ???It is neither good, nor bad. Using VARs in each procedure keeps them local to that procedure. Declaring VARs once at the top of your program makes them global to all procedures. ???If you are only using a value within a procedure, then it is neater to make it a local variable, even if it has the same variable name in several procedures. If several procedures need to access the current value, then you can make it a global value, but bear in mind if one procedure changes the value another procedure cannot get the old value back. ???Another way to share values is to pass the variables into and out of a procedure using a parameter list. This is the best way to make your code readable to other users and to yourself later, as when you revisit it several years down the road. ???If your script is small, then it probably doesn't matter how you get it to work, but as it grows to the point where it spans several pages, then using a well structured approach pays off in spades. Raymond
  3. In VW 12, rotation of Rectangles and Ovals always creates a Polygons and Polylines, respectively. So, before you use the Offset tool, you are working with an approximation of the Oval made of Bezier segments. Rectangle and Oval rotation wasn't fully implemented until VW 13 (2008) Raymond
  4. Hello Richard, ???Short answer, Yes. The question becomes, "to what degree?" I have used VW for the last 20 years for circuit board design and similarly related graphical uses as it pertains to Integrated Circuit interface design. I've seen remarkable drawings of bridge designs, motorized vehicle designs and then of course there's the architectural side of it all. ???Though VW has hundreds of drawing tools, and hundreds more commands, I believe the most powerful facet of the software is the scripting language, VectorScript (and its evil twin, in the SDK). VS has over 1700 commands and provides the user with enormous options to use VW in yet to be defined ways. I cannot answer your NURBS question directly, but surely someone here will soon. ???We are practically neighbors. If you'd like to discuss this further, offline, I'd welcome the chance to talk about the strengths and limits of this software. You can either send me a PM or use the email address from my profile. Raymond
  5. I do. Thank you, Pat. I wanted to reference it in a post today and could find neither hide nor hair of it. Memory's the first thing to go. By the way, have you seen my car keys? Raymond
  6. It was here, at the top of the VS Forum for a long time - a post by Robert Anderson outlining the steps needed to install and run a VectorScript. Where did it go? I've searched the Techboard archives and the KnowledgeBase to no avail. Was it removed for a reason? Did it disappear inadvertently? Can we get it back? Raymond
  7. Charles, ???Not reading things as written is a penchant of mine. OK, I got it - finally. In the same vein, I don't know how many times I've answered a question that was never asked, only to reread the original post before sending and scrap my entire draft. The follow up answer is, almost always, very short. ???On the topic of using arrays, a few months back I used a dynamic array of handles to apply random attributes to objects. I was amazed how much faster it was compared to the same code that stepped through the list of handles with a WHILE loop and NextSObj(). For 10-30K objects the array method was MUCH faster. Everything has its place. Raymond
  8. Charles, you da' man! Charles is 100% right (except for me suggesting an array :-p ). When you move the PIO out of its container (the wall) there is no next object after the PIO, so you have to get the next node before you cut your lifeline. An array of PIO handles will work, too, but I think this way is easier. Procedure test; VAR h, hInternal, SaveMe : HANDLE; boo : BOOLEAN; Procedure doit(h:HANDLE); BEGIN IF (GetType(h) = 68) THEN BEGIN { WALL } hInternal := FIn3D(h); WHILE (hInternal <> NIL) DO BEGIN SaveMe := NextObj(hInternal); { look ahead before you cut your link } IF (GetType(hInternal) = 86) THEN BEGIN { PIO } boo := SetParent(hInternal, ActLayer); SymbolToGroup(hInternal, 0); END; { if } hInternal := SaveMe; { continue or reconnect } END; { while } END; { if } END; { doit } BEGIN ForEachObject(doit, ALL); END; Run(test); Raymond
  9. SymbolToGroup() doesn't work inside a wall, but it does if you move the PIO into the open, where it becomes a sitting duck. Try this: ???if SetParent(PIOhand, ActLayer) then ??????SymbolToGroup(PIOhand, 0); Raymond
  10. Have you tried SymbolToGroup(H, #)? Not sure if it will decompose a PIO, but it's worth a try. Raymond
  11. ????????Matter without density, now there's an interesting concept. VectorBub, ???You are right, so you should build your own. To add a fixed amount to a circle, you need to know its starting diameter. The ending diameter is the starting diameter + 2 * (radius increment). ???A nice way to implement this is by defining a function that accepts an increment and returns a scale factor; This is especially useful since your circles do have different diameters. function GetScaleFactor (H :Handle; RadiusInc :Real): Real; { Return the scale factor needed to change a circle's diameter by a fixed amount. } Var ???StartDiam, EndDiam :Real; ???X1, Y1, X2, Y2 :Real; Begin ???GetBBox(H, X1, Y1, X2, Y2); ???StartDiam := X2 - X1; ???EndDiam := StartDiam + 2 * RadiusInc; ???GetScaleFactor := EndDiam / StartDiam; End; { GetScaleFactor } ???To use it, you already have the center XY from hCenter: hCenter (H, X, Y); ScaleF := GetScaleFactor (H, 2mm); hScale2D (H, X, Y, ScaleF, ScaleF, False); ???Watch your units. Other than that, this will work every time. Raymond
  12. Hi Pat, ???hScale2D - born on version - VW 10 ???hScale3D - born on version - VW 12 I recently went through the VS Func Refs and the "backwater documentation*" to determine when things appeared (and disappeared). This was a little OC on my part, but good info if you really want to know. Raymond * VWPluginLibraryRoutines.p, in the user's plugin folder.
  13. Use: ???hScale2D(H, Xcen, Ycen, ScaleF, ScaleF, False); Raymond
  14. Tom, ???The last field in the Symbol() command is the rotation field. Angle data is preceded with a "#". e.g.: ???Symbol('Sym Name', X, Y, #30.2);?????{ rotates symbol 30.2? CCW } And, yes, VectorScript is based on Pascal, about 95%. Also, Symbols can contain other symbol, as long as you don't have circular referencing. You can also write your code as a typical program, with variables and calling routines, but if you already have your data in Excel, inline code works quickly and easily. Welcome to the other side, Raymond PS - for a list of VS commands, download the following: http://download2.nemetschek.net/nnapub/misc/2010/2010VectorScriptReference.zip
  15. Hi Tom, Do a lot of the circles have the same diameter? If they are all unique, it will be better to just draw circles instead of place symbols. If you choose to use Symbols, you will first need to create the symbols before you can place them. Since you are exporting from Excel, you can easily generate a VectorScript to do it for you. For Circles w/o using symbols, format your data like this: ???ArcByCenter( Xcen , Ycen , Radius, #0, #360); where "ArcByCenter(" , the two "," and ", #0, #360);" are text fields with your values of X, Y and Radius (shown in bold) in between. Don't worry about the tabs that export between columns out of Excel as they are treated the same as spaces in VectorScript. To define your symbols, do the same as above, but create the circles at (0, 0). ???BeginSym('Circle 1'); ArcByCenter(0, 0, Radius1, #0, #360); EndSym; ???BeginSym('Circle 2'); ArcByCenter(0, 0, Radius2, #0, #360); EndSym; etc. One circle for each unique diameter. Each one will need a unique name for referencing later. (Circle 1, etc.) then place them with: ???Symbol('Circle 1', X, Y, #0); ???Symbol('Circle 1', X, Y, #0); ???Symbol('Circle 1', X, Y, #0); etc ???Symbol('Circle 2', X, Y, #0); ???Symbol('Circle 2', X, Y, #0); etc. ???Symbol('Circle 3', X, Y, #0); etc. When you have all of this assembled in Excel, copy it to a text file and save it. Then go to menu File > Import > Import VectorScript.. If you generate errors, correct the data and repeat. Once you get this to work you will be able to mock up all kinds of patterns in Excel and have them drawn in VW very quickly. HTH, Raymond
  16. It might. :whistle: You're welcome. Raymond
  17. Nicholas, ???Here is a short script that will return the length of one 2-vertex 3D Poly. Of course, a favorite program of mine will do the same and a whole lot more. ;-) ???If you are looking for the length of all selected Polys, that's easy, too. PROCEDURE Length3DLine; VAR P0, P1 :Vector; BEGIN GetPolyPt3D(FSActLayer, 0, P0.x, P0.y, P0.z); GetPolyPt3D(FSActLayer, 1, P1.x, P1.y, P1.z); Message(Norm(P1-P0)); { Length of vector between 2 points } END; Run(Length3DLine); Happy New Year, Raymond
  18. After answering a question yesterday about the constants for the Interactive Settings in the VW Preferences I realized it would be nice if the entire VW Preference Dialog were annotated the same way. It's been a while since I posted anything, so here is a small year end gift. The majority of the constants can be read with GetPref() and SetPref() as boolean values - anything with a checkbox or radio button is typically a boolean value. The PopUp menus and the Sliders with integer values can be accessed with GetPrefInt() and SetPrefInt(). The Sliders with decimal values and the Text fields that take distance or time entries can be accessed with GetPrefReal() and SetPrefReal(). These functions are described in the VectorScript Function Reference that ships with the VW software (most of the time), or online at NNA's download page. If any of the data in this post is incorrect, please contact me (PM) and I will correct and reload the file. Happy New Year, everyone. Raymond
  19. As I said, I haven't played with this, but you mention Foreground Render Type => GetObjectVariableInt(H, 1036). Have you looked at the VS Function Reference Appendix? In the middle, under Viewports, there are a slew of constants that access veiwport settings. I apologize that I assumed you knew about it if you did not. There is an online version and a downloadable version. There should also be one in the VWHelp folder in your VW application folder, but some have posted they don't have that. On the page you cited: http://www.nemetschek.net/support/custom/vscript/docs.php, the last link is the downloadable version of said VSFuncRef. It is working. When using the object variable calls, be careful of data type. There are boolean, integer, longinteger, real, and string versions of Get and SetObjectVariableXXX() - where XXX is the type of the call. If you use the wrong type, you will still get data out, but it will be meaningless. In the function reference appendix, the types are listed after the constants. Happy hunting. Raymond
  20. I haven't played with this but you might try "value := GetObjectVariableInt(H, 1001);". See what values it returns for viewports with different rendering setting. If they vary, then try "SetObjectVariableInt(H, 1001, value);" to see if that is what you are after. Raymond
  21. You are welcome, Highpass Petri, your woods are lovely, dark and deep. Raymond
  22. Use Move3DObj(0, 0, dZ); to move an individual object. To generate a random value between to numbers, use the following function: function RandVal(LL, UL :Real) :Real; { Generate a random value in the range LL -> UL inclusive. } Begin UL := UL - LL; RandVal := Random * UL + LL; End; { RandVal } By sending the appropriate limits to the RandVal function you can control whether your objects move up or down. Raymond
  23. How are you importing the data? What format is it in?
  24. Hi Justin, ???If you are going to create multiple copies and want to get at their handles after your repeat loop executes, you'll probably want to save them as you create them. Try something like this: VAR ???HArray = DynArray [ ] of Handle; ... Cnt := 10; Allocate HArray[0..Cnt]; n := 0; HArray[n] := MyObjectHandle;???{ element 0 holds handle to original } REPEAT ???n := n + 1; ???HArray[n] := hDuplicate3D(HArray[n-1], 0, 0, Zspace); UNTIL (n = Cnt); Raymond
×
×
  • Create New...