Jump to content

JBenghiat

Member
  • Posts

    2,028
  • Joined

  • Last visited

Everything posted by JBenghiat

  1. These look like OS level settings. LIkely these values are stored in memory via the OS routines that handle the open / save / export dialogs, and VW reads, then writes these values on quit. Why are you trying to set these particular values via VS? If it is for user interaction in a script, just use GetFileN, which lets you designate a default path. -Josh
  2. I think you'll want to look at State Notifications. http://developer.vectorworks.net/index.php?title=VS:Parametric_State_Notifications] Essentially (grossly over-simplified): IF note_field changed THEN ForEachObject of the Plug-in IF the tag matches the current tag THEN Set the note parameter with SetRField ResetObject -Josh
  3. Matt, Did you look at the Tomcat and JTE web sites? The drawing are dwg, but fairly decent. -Josh
  4. Saved settings get read from disk on application open and written to disk on application close. Changes you make to the xml in memory should write on exit. What exactly are you trying to change in SavedSettings.xml? Many of the application settings have their own SetPref or SetVariable calls. It's also possible that you are writing to a setting that gets read by the quit process. For example, palette positions are read on quit, so any custom change would get overwritten by the actual GUI. Does that help? -Josh
  5. Your last paragraph made the most sense out of your explanation :-) I believe what you are saying is that you want the PIOs to access a note from a central database rather than an individual parameter field. There are several approaches to this. Are all instances of the PIO referencing the same data or are there several variants of the PIO instances, where each group would reference a different note (eg. 3 notes among 12 instances)? If they all access the same data, the easiest route is to store the text in the PIO's default record, and to edit the text via a button event. If there is a menu of notes from which to choose, then you to need some sort of id tag for each kind of note, and would want to use states to detect if a field changes and copy that data to other PIO's of the same note id. Which of those best describes what you are trying to do? -Josh
  6. The truss object has some issues with direct texturing. The easiest solution is to assign a texture by class (which is not a bad best-practice, anyway). -Josh
  7. Control points are indeed relative to the origin of the PIO. A CP 12" above the insertion point, for example, should have the coordinates (12, 0). They are also on a grid rotated with the PIO, so by "above," I mean with respect to the PIO's rotation. When you interact with a CP, you can get accurate cursor coordinates, but those values are not the same as those stored in the OIP. There are some issues with a user-moved origin causing incorrect CP values in the OIP. You may want to check that your origin is reset for initial testing. A CP is really just an extra reshape handle. I think what you are describing for your needs is actually a locus representing the centerpoint and x-center, y-center parameters for the OIP. You would need to calculate the center of the object with respect to the PIO origin, then add that to the insertion point of the PIO, which you can get with GetSymLoc. Don't forget to account for the PIO's rotation -- vectors can be your friend. -Josh
  8. Ash, Look at ValidNumStr in the Utillities category. It handles unit marks as well as things like trailing spaces. Developer.vectorworks.net even has a model for rewriting Num2Str. -Josh
  9. Once you set a handle variable to point to an object, you can do any handle operation to that variable and it will affect that object; HMove, HDuplicate, AddSurface, etc.. As long as the operation doesn't destroy the object. For example, once you apply add surface to two objects, the original objects no longer exist. You can also set the variable to point to a different object. Say, for example, you have a script that creates and modifies text three times, you can call txtHan:=LNewObj three times, and txtHan will end up pointing to three different objects. Handles are temporary in that their values do not persist from script to script. You can't, for example, store a handle to a database and then find the same object by reading that value on a subsequent script run. -Josh
  10. Tui, For new coders the concept of handles can take some getting used to, so maybe this will help: A handle is a temporary unique identifier applied to every object handled by the script. I think you may be confusing handle variables, which are just pointers to an object, with handle data, the unique tag attached to each object. In your case, AddSurface gives you a handle to the newly created surface. As the original objects no longer exist, the argument handle variables no longer point to objects. Assume JkEndC, JkBotC, and JkTopC are all handle variables pointing to valid 2D objects. JkTrAdd:=AddSurface(kEndC, JkBotC); JkTrAdd:=AddSurface(JkTrAdd, JkTopC); JkTrAdd now points to the added surface of all three objects. If you want your code to be more foolproof, you could check that any of the handles <>NIL before each add step. HTH, Josh
  11. Also, see here for current Dialog Builder versions: http://developer.vectorworks.net/index.php?title=SDK:Dialog_Builder
  12. I have actually found 2013 to be one of the more stable versions and have only had an occasional complex-rendering related crash. While there may be some issue that causes VW to crash consistently, which must be very frustrating, I believe it has to do with a workflow or configuration used be a minority of users. I do know that NV investigates crashes thoroughly, but they can't fix what doesn't get reported. I encourage you to visit http://www.vectorworks.net/support/bugsubmit.php and submit crash logs, test files, and any actions that may consistently cause a crash. You probably won't get a reply unless they require further information. Bug submits are not the same as tech support, so those who have already contacted tech support, your issues may not have necessarily been submitted as bugs. You can also contact tech support so that they may talk you through some troubleshooting steps. There are two suggested fixes in this thread. Perhaps some other users will post some successes. -Josh
  13. Hi Larry, In general the offline reference is not as well updated or annotated as the developer site. I dug up information on the integer settings and updated the developer wiki: inFlipSpecifier = 0 for flipH inFlipSpecifier = 1 for FlipV -Josh
  14. Larry, Look at FlipHybMatrixObj. http://developer.vectorworks.net/index.php?title=VS:FlipHybMatrixObj This is not an absolute function, so check IsObjectFlipped. -Josh
  15. Many programming languages can access a boolean as a 1 or 0 (which is how the value stores in memory), but Pascal only lets you access the key words. You can write a simple function to convert a boolean to an integer. PROCEDURE MyScript; VAR bool1, bool2, bool3 :BOOLEAN; {---------------------------------------------------------------------} FUNCTION Bool2Int(inBool :BOOLEAN) : INTEGER; BEGIN CASE inBool OF TRUE: Bool2Int:=1; FALSE: Bool2Int:=0; END; {CASE} END; {---------------------------------------------------------------------} BEGIN bool1:=TRUE; bool2:=FALSE; bool3:=TRUE; Message(Bool2Int(bool1)+Bool2Int(bool2)+Bool2Int(bool3)); END; Run(MyScript);
  16. For reading the values, ValidNumStr is your friend. Num2StrF is useful for writing. When dealing with worksheets, I have two versions of any variable I am reading -- one as formatted text and one as a number. HTH, Josh
  17. If I remember, all the text in the Martin symbols in a class, which may be off as yo are trying to edit the symbol. There is nothing special about the text - i.e. it is not part of a label legend - so you can hide it in viewports if it is not useful to you. -Josh
  18. Setting the view to top is generally still needed for path-related functions. There are a few things you can do to speed things up. Get the view: GetView(xAngleR,yAngleR,zAngleR, offsetX,offsetY,offsetZ); Check the view first: If xAngleR,yAngleR,zAngleR are all 0 then don't change the view. You should also check the the projection GetProjection() IF (Projection <> 6) & ((xAngleR<> 0) | (yAngleR<> 0) | (zAngleR<> 0)) THEN SetView() You can also use SetPref(9873,TRUE) to prevent a screen redraw when the view is changed but then you MUST call SetPref(9873,FALSE) after you set the view back. You will see the largest speed increase in a 3D view from this.
  19. Have you figured out how to make a symbol containing symbols and how to make a report? In the report's worksheet, you need to edit the database criteria. See the VW help section Worksheet Commands, and look at "Edit Criteria." Check "Symbols" box in the "Including components of" section. HTH, Josh
  20. There seems to be a bit of a bug in the settings if you wish to only color objects in a specific class. In order for coloring to work, select Lighting Device color by Color field and uncheck pen and fill color. Also, please note if you wish a Lighting Device to take on the color of a class, you must set the object to color by class in the Attributes palette. -Josh
  21. I think your best option is to put the calculation code into a procedure or function in an include file. That way you write (and can revise) the calculation code once, but you can use it anywhere you wish. -Josh
  22. I made a slight misstep in my earlier post - At least on the Mac, you can also use a UNIX style path -- so your include can be at: /Users/username/my scripts/include.px That way you can have one copy of the code for several versions of VW, and avoid library issues altogether. -Josh
  23. In general, the starting path for an include is the file from which it is run. For Plug-Ins, this is the plug-ins folder, and for files, it is the document. Alternatively, you can include full paths-- Macintosh HD:Users:Username:VS Includes:file.px|vss Macintosh HD/Users/Username/VS includes/file.px c:\Users\Username\Documents\VS includes\file.px That allows you to have the include file anywhere, which can be very useful. -Josh
  24. Are you aware of the Vectorscript Language Guide? You can find it at the end of the contents in the help app. There are sections on encryption as well as include files. Efficient encrypting can be confusing, but the VSLG is a good place to start. -Josh
  25. The predefined dialogs are a fixed size, and so only support limited string lengths. If your string is greater than 255 characters (I think alert text may be even smaller), you will have to write a custom dialog. I believe there are some dialog examples on the Vectorworks.net main site under Support>Customization>Vectorscript>Examples. -Josh
×
×
  • Create New...