Jump to content

Dieter @ DWorks

Member
  • Posts

    2,825
  • Joined

  • Last visited

Posts posted by Dieter @ DWorks

  1. I think at the moment I will be deveoping in Python until I have a more comfortable feel of the OOP overall; at the same time thanking Dieter with his awesome Python VW Library..

    Great to hear that others really benefit from it. I'm working on a better version of it, as I didn't got everything right from the start. (as is normal for every software thing). Even adding some more helpful docs to get you started as imho, there are some really helpful stuff in the library to setup your plugin very easily. Everyone is welcome to collaborate, even if it's just logging issues are wish list items etc...

  2. @JIM: There once had been talked about not releasing yearly anymore, but releasing each feature when it was finished, so that VW would be more a continual updating program, which would benefit both the development team and the users, as users would have the chance to learn the new/improved tools in a timely manner, and not all at once, etc.... Are there still plans for this, as I would really love to see this, as I believe this will also open up the transparency to the users about the direction VW is going.

  3. Hi, JBenghiat.

    I've tried your suggestion and it works when I create a command but it doesn't when I create the same code in a tool. Any reason for that?

    Thank you (code below)

    import vs;
    
    def PickPointCallback(pt):
    vs.AlrtDialog( "Point {0}:{1}".format(pt[0],pt[1]) )
    
    vs.GetPt( PickPointCallback )

    Not an answer, but you can use lambda's and the % string format to shorten your code:

    vs.GetPt(lambda pt: vs.AlrtDialog('Point %s:%s' % pt))

  4. This is already in dlibrary, a helper library for python plug-ins: https://bitbucket.org/dieterdworks/vw-dlibrary/src/42443e6a43ea0c54b49d17e71a9b1071a6a0e908/dlibrary/document.py?at=master&fileviewer=file-view-default

    check out the Units class from the document module. It's full with helper methods for this kind of thing.

    Also, in dlibrary, many other functions will let you enter both a number or a string with the number and unit for their parameters, which is super helpful.

    Everyone is free to contribute to it.

    Especially this function:

    @staticmethod
    def resolve_length_units(dimension):
       """Will return the same, but length unit strings will be transformed to floats.
       For a float or str dimension, this will return a float.
       For a tuple, which would be a point, this will return a tuple of floats.
    
       :type dimension: float | str | tuple
       :rtype: float | tuple
       """
       if isinstance(dimension, str):
           return Units.__validate_length_str_to_length_units(dimension)
       elif isinstance(dimension, tuple):
           return tuple((Units.__validate_length_str_to_length_units(item) if isinstance(item, str) else item)
                        for item in dimension)
       else:
           return dimension
    

  5. There are a couple ways to do this.

    The fast way is to draw the shape of the projection, then AEC > Pillar…

    This will create a pillar that walls can join to.

    In your particular case, if you are using wall styles, you can make a wall style that is super wide for the area in question.

    Walls that butt join can be joined with the wall join tool in the L mode.

    hth

    mk

    I find the thick wall solution the fastest and easiest in this kind of situations.

  6. Thanks Hippocode and Dieter for replying.

    It would be easier to use a popup, which is what I've been using until I found out about the SymbolDisplayControl function.

    The reason I'm trying to get SymbolDisplayControl to work is because it has a bigger preview window.

    This exercise is to enable our users to browse our Architectural Details from an external file/files. By text search and visual display.

    One way to avoid the bigger display is to choose names that really says what it is, so they can see from the smaller preview what they want. I know it's not the same, but sometimes you better don't go to far just for a small usability improvement when you don't have full control of the main program.

  7. Will it not be easier to use a ThumbnailPopup? This in combination with a resource list will do what you are asking, without the need to import symbols, this will be so much easier.

    Something like this:

    1. You can build a resource list with resources from other documents, so you'll have access to them without needing to import them.

    2. You can use a resource list to fill up the thumbnail popup, and VW will show them with the preview, like you can see them in the resource browser.

    3. You can then add your own filtering, by refilling the popup after the filter has changed.

  8. Also, don't forget that Python is case sensitive

    This is the killer for me.

    PYTHON IS CASE SENSITIVE.

    python is case sensitive

    Python is Case Sensitive.

    More time debugging this than anything else.

    That and the fact that it is also indent sensitive. Where you would use a Begin/End in VS, you have to indent properly instead.

    Case Sensitivity is in a lot of programming languages, and I prefer it. Using a good IDE with code completion, there is no problem with it.

    • Like 1
  9. For that last question, make sure your files always and with a blank line! I learned this the hard way, and it took me a while before I figured this out. If one of your files don't have it, VS will throw errors that are unrelated, so than it's happy hunting.

    Developer mode should be in the VW settings, with all the other ones. (I have a Dutch version, so no point of telling you the name.)

    The OIP will be populated with the plugin parameters. The widgets used depends on the parameters type.

    Also, make sure to check out http://developer.vectorworks.net/index.php/Main_Page. it contains a lot of valuable info on scripting, with examples.

    Add yourself to the mailing list: http://www.vectorworks.net/community/mailinglists. You can then look up problems others had, and help with new ones. I find it also a great learning resource, as if you can't help, you can learn from the solutions of others.

    Oh, and if you are just starting out, I would suggest using Python for you scripts, as it's so much better and easier to use! If you go for Python, also check out https://bitbucket.org/dieterdworks/vw-dlibrary, a free open-source library for making plugin development so much easier.

    Welcome to the scripting world of VW!

×
×
  • Create New...