Jump to content


  • Posts

  • Joined

  • Last visited

Everything posted by Gonda

  1. Hey All, So, I've been working with Dialog Build for the last couple of days. Finally got my dialog finished and when I exported it, I noticed that Dialog Builder appended semicolons to the end of all the lines in the "#set alignments" section. Not that it matters functionally, but I figured for consistency this should get filed as a bug report. Cheers, -gonda
  2. Hey All, So, after doing a lot of digging through the absolute cluster which are line types/styles/dash style (it seems to vary depending on what function your looking but these seem to all be the same thing), I was wondering if there is a way to define a line type that uses World Units instead of page units. To this end are there actually two different types of 'line type' objects? When I imported any of the various ISO line types, I get a very different dialog as opposed to creating a new line type resource in the resource browser. Any one have thoughts on this? I'm almost wondering if I've stumbled across an incomplete area of the API... Cheers, -gonda
  3. Hey Raymond, So, maybe I'm missing something, but when I pasted your script into a command plug-in, I get units with both outputs. Am I missing something? -gonda
  4. Hey All, So, can anyone explain or point me somewhere that explains how Line Types currently work? As far as I can tell, line types are defined in page inches. How does this relate to document Units, Layer Scale, etc. Also, is there a way to have a line type that has a constant screen scale? i.e. The line type always shows up with the same level of of detail regardless of zoom level? It seems that this used to just work before they changed line type/style into resources. Cheers, -gonda
  5. Hey Raymond, Thanks for the info. This is basically what I'm looking for. I don't suppose there is a way to force it to print unit marks? I notice it does for Feet/Inches but seemingly it doesnt for metric units (i.e. mm, cm, m, km, etc) Cheers, -gonda
  6. Hey All, So, I'm looking to retrieve some fields from a custom PIO object and then drawing them as text in the document. I've defined the parameters as dimensions so that when the units of the document changes, units of said fields in the OIP change and you case use standard entering of numbers with units. What I'm getting stuck on if formatting these values. Whether I use PParametr_name or GetRField() to obtain these values, theyre always returned as a real number. Is their either a different function that I should be using to return the values as VW displays them in the OIP (i.e. 3'4", 54mm, 7.6m, etc) or is there an inbuilt function to convert the reals to display based on the documents current primary/secondary unit info or is this a function that I am going to need to build? Cheers all, -gonda
  7. Hey Josh, So, I found the MiniCAD Hooks file and it's a great reference. I've found all the info for the ObjXProp info; however, unless I'm missing something, I can't seem to find anywhere either in that file or elsewhere in the SDK files that lists the EventID Constants. Any other ideas? Cheers, -g
  8. Pat & MullinRJ: It is broken. If I set the text size, push and then pop, the text size should be what I set it at and this is not what is happening. Unless the PushAttrs() function is also clearing everything it pushes, it is not doing what the documentation indicates nor. JBenghiat: I'll look into that. It just seems that that is adding a lot more overhead and function calls since you're calling SetTextSize for every Text Block you create instead of just once. -g
  9. Unfortunately, I was actually doing a lot more than in the example I posted...I omitted a lot of things for readability. Hopefully this will get fixed in the next service pack. For now I'll have to settle for writing code that is hard to read and maintin Cheers, -gonda
  10. Hey Pat, So, I've done a little bit more digging and I think I've found the culprit. It seems there's an issue with the vs.PushAttrs() and vs.PopAttrs() functions. Ex: (This seems to work just fine) vs.PushAttrs() vs.TextSize(0.4) vs.CreateText("Test") vs.PopAttrs() Ex: (This fails) vs.TextSize(0.4) vs.PushAttrs() vs.PopAttrs() vs.CreateText("test") I'm guessing as part of the Push/Pop functions, there's either an integer cast or rounding happening which is why anything less than 0.5 seems to fail. Cheers, -gonda
  11. Hey All, So, I don't know if anyone has done a lot of drawing of text through python, but I think I've either found a bug or am completely misunderstanding how to vs.TextSize works. I realize that text size changes relative to Layer Scale. In my script have defined a scale factor to take this into account. The problem that I seem to be running into, is that when the drawing is set to Millimeters for units, the smallest that I get the vs.TextSize function to draw is 1. When I set the font size to less than 1, the text doesn't draw at all. Now if I just drop a text object into the drawing, I can seemingly set the Font Size down to at least 0.01 Point via the OIP pulldown. I may be wrong, but it appears as if the vs.TextSize function, even though it says it accepts non-integer values, appears as if it is applying a rounding function to the input before passing it to the actual drawing routine within VW. Has anyone encountered this before or am I just overlooking something that is completely obvious? Cheers, -gonda
  12. Hey All, So, I'm working on implementing a Custom Object in python that I want to have Events enabled for. I understand the I need to use vsoGetEventInfo function to get the Event ID and any related info (Control ID, Button ID, etc)...my question is, if there a list somewhere of all of the possible Event ID Integers and descriptions of what each of them are? I've tried looking through the dev documentation and I've found a few scattered here and there in various examples but I have been unable to find a comprehensive list. Does anyone either know where one of these is or has a list that they can post? Cheers, -gonda
  13. Thanks for the info Josh...I figured there was something like this...unfortunately, the class vs.HandleContainer doesn't seem to have a Handle (or HANDLE) method and all the permutations I've tried of vs.NIL generate undefined errors... I don't suppose you know of a documentation source that describe the internal object classes and there supported methods/variables? Cheers, -gonda
  14. Hi All, So, I've been working on a script that uses vs.NextObj to iterate through a list of objects. I know that when it gets to the end of the list, according to the function reference, it will return NIL. The problem I'm running into is what exactly 'NIL' is and how to test for it. Canonically, testing for existence in Python uses: "if foo is None"...I've tried testing the returned handle again pretty much everything I can think of (0, 1, NIL, nil, Nil, False) and all of them fail...I did discover that if you try to type() the returned handle, it comes back as a member of class vs.Handle...is there a method of this class to test for existence? Cheers, -gonda
  15. Hi All, Is it possible to remove/delete items from a Layout? i.e. Pressing an "Add" button adds a text entry box and pressing "Remove" deletes a text entry box. I've found plenty of functions for creating, moving, editing, etc, but none for deleting which seems odd. My issue is that I need to create a Layout/Dialog that is dynamically generated so prearranging everything and just showing/hiding items will not work. Cheers, -gonda
  16. Hi All, So, maybe I'm missing something obvious, but I can't seem to find a way to create a selective group via Scripting. Example: There are 3 objects selected. Based on some processing, I want to create a group containing 2 of these objects. Group() will create a new group, but it only works on all of the selected objects. The BeginGroup() function can do selective grouping; however, as far as I can tell, it can only handle creating a group based on newly created objects. Anyone have any thoughts or am I just missing something completely obvious? Thanks, -g
  17. Hi All, So, when working with Python scripts, is there any way to access current states of things? Specifically, I'm working on a tool that will take multiple selected objects, read information from them, compute and then modify the objects. What I'm running into is that it seems that most functions want a handle to an object to do anything useful...I've found I can use a custom selection via criteria; however, I can't find a way to get from a selection based on criteria to object handles. In a perfect world there would be some object or method (ie vs.CurrentSelection(). ) that would return either a single object handle or a list of multiple object handles...any thoughts and/or am I missing something obvious? Thanks, Jon Gonda
  18. I can, but it still seems that I would need a different _main.py for each script/command I would want since I would have to alter _main.py for each. I could do the dialog thing, but I was really hoping to be able to build a bunch of scripts that could be activated via key commands... Guess I'll just have to get back to trying some way to hack around the system... Thanks
  19. I could be misunderstanding the sample, but it sounds like the plug-in is locked in to running only a file called '_main.py' and since it says to just dump it in the Plug-in's folder, this effectively means that there can only be one copy of it so it wouldn't really work for managing multiple added commands. I figured there would be an easy solution to this since VW seems to already be able to run scripts located anywhere on the HD from the 'Run Script...' command.... -g
  20. Hi All, So, I know it's possible to run external Python Scripts via the "Run Script..." menu item, but I was wondering if there is any way to add a menu item to a menu that is linked to an external script (ie, not having to manually select the script to run everytime). This is mostly a function of that fact that the built in editor in VW is pretty crap for Python and it's frustrating to be trying to write/debug a script and the have to constantly be going through a number of windows just to get to the editor and then backing out of said windows to run the script... Thanks, -j
  21. Hi All, So, basically, I'm trying to have a way to effectively have sub-layers. Specifically, I'm looking to have a way to group a given set of layers into a super-object from which I can access the individual sub-objects. I can't do this with classes because because those are already in use across multiple layers. I was thinking of doing this by creating a viewport with the given layers I want set to visible. What I'm running into is trying to find a way to return all of the visible layers for a given viewport. From what I can see reading through the API documentation, all of the functions which relate to viewports are override related as opposed to set/return type functions. Am I missing something here? Thanks all, -g
  • Create New...