Jump to content

_c_

Member
  • Posts

    2,434
  • Joined

  • Last visited

Posts posted by _c_

  1. And thinking better: items within Python's tuples are immutable. The routines can thus only return a new tuple.

    So I see these options:

    • var v = ( x, y, z ) if a vector variable is preloaded with a third item, return a new tuple whose var[2] has the preloaded var[2] value
    • var v = ( x, y ) if not, return a tuple in the form ( x, y, 0 )

     

     

    • Like 1
  2. Yes, I experimented extensively and added various notes and will add more in these days, hopefully this will help other Python novices.

     

    I kept on trying to fetch vectorial data and getting abstruse nonsense values. 

    The loss was due the fact that, in spite proper 3-dimensional inits:

    • both routines GetPolyPt and GetPolyLineVertex return 2-dimensional tuples, shortening if longer.
    • vector routines expect 3-dimensional tuples or return gibberish

     

    I think that both GetPolyPt and GetPolyLineVertex should simply set the first two items and leave the third alone. It does feel wrong, when an item is deleted from a tuple.

    There are scenarios where a z value is preloaded. 

     

    But as always is rather a matter of finding an acceptable workaround (and documenting the problem), which in this case was easy.

    As a principle all problems I am having in Python are due to the way vectors are accessed, manipulated and resolved. So, that overcome, all will be well.

     

     

    p = vs.GetPolyPt( polyHandle, vtx1 ) # sets a tuple with 2 items in the form ( 0, 0 )
    ang = vs.Vec2Ang( (p[0], p[1], 0) ) 
    # make sure that there is a z coordinate or vs.Vec2Ang will fail, if p has only 2 items (VS Python only, Pascal OK )
    
    # alternatively
    
    if len(p) == 2:
        p += (0,) # add a 3rd item to the tuple
    ang = vs.Vec2Ang( p ) # returns angle
    
    # FAILURE EXAMPLES:
    # ang = vs.Vec2Ang( p ) # always returns 90
    # ang = vs.Vec2Ang( (p[0], p[1]) ) # always returns 90

     

    https://developer.vectorworks.net/index.php/VS:Vec2Ang

    https://developer.vectorworks.net/index.php/VS:GetPolyPt

    https://developer.vectorworks.net/index.php/VS:GetPolylineVertex

     

  3. It is good that I am a person with lots of patience and a good measure of endurance... after I don't really know how many days of early morning trials I finally managed to discover the reason of some heavy quirks in my [never ending] ramp project in Python, my current baby.

     

    And here they are, for you NOT to go through the same:

    • vs.GetPolyPt and vs.GetPolylineVertex return a bidimensional tuple
    • If you passed some z values before in the third slot, you'll loose them
    • expected: set items 0 and 1, leave 2 as it is. Certainly not shorten the tuple!

    The fact that these routines kill the third item is also bad for usage in the vs vector routines, such as vs.Vec2Ang, which expect a 3-items tuple.

    Is this a bug or expected behaviour in Python?

     

    Try this:

    # test GetPolyPt
    p = (0, 0, 0)
    vs.AlrtDialog( 'init tuple: ' + str(len(p)) ) # 3 items
    p = vs.GetPolyPt(vs.FSActLayer(), 1)
    vs.AlrtDialog( 'after GetPolyPt: ' + str(len(p)) ) # 2 items?!?
    
    # test GetPolylineVertex
    p = (0, 0, 0)
    vs.AlrtDialog( 'init tuple: ' + str(len(p)) ) # 3 items
    p, vertexType, arcRadius = vs.GetPolylineVertex(vs.FSActLayer(), 1)
    vs.AlrtDialog( 'after GetPolylineVertex: ' + str(len(p)) ) # 2 items?!?

     

  4. Hello,

     

    I'd like to collect and study some valid third party Python libraries for Vectors, what do you use?

    So far I tested:

     

    thank you

    _c_

     

     

    • Like 1
  5. Like many before me, I am struggling to get any kind of User Interaction work in custom plug-ins. This is Vectorscript-Python only, Vectorscript-Pascal works flawlessly.

    This affects routines like vs.GetPt, vs.GetPtLn, vs.GetPickObjectInfo, vs.TrackObjectN, etc.: there is no way to set global vars, and most attempts crash VW.

    I read over and over all posts in the present list, I cannot get it done.

     

    I am fairly new to Python, so first of all I ask: is anyone aware of a way to get above mentioned routines work in custom plug-ins?

    If yes, please let me know how. Otherwise, I'd like to file bug reports. Hopefully we can get a fix at one point, since this problem is recorded since Python was introduced in VW.

     

    There are two things discouraging users to switch from Pascal to Python: lack of user interaction support and weak code encryption.

    If we could resolve the first it would be great.

     

    Please @K.Lalkovski, can you help us there?

     

    Thank you

    _c_

  6. 3 hours ago, shorter said:

     

    You only need to model to 1:100 to coordinate models with consultants.

     

    Are we now in for a sterile discussion?

     

    Others [for example us] might need it, I am afraid. 

    We speak about generated sections or elevations from shipped objects. That's something particular, different than coordinating models. That's standard plans and sections, no matter how you get them, they must comply to the environment they are to be used into.

     

    [deleted. This is indeed so useless]

     

  7. 7 hours ago, zoomer said:

    And another question,

    where could I set IFC Buildings in VW ?

     

    As like Zeno,

    I basically have 2 separate Buildings in my single File.

    And as their Stories differ, I have duplicate Layers for each Building.

    (And even 2 of them per Story for each Building)

    Which makes it a bit tedious to switch visibilities.

     

    Even if I create a Story+(no Levels)+Layer Setup.

    It would export both Story Sets as a single Building which would not help much.

     

    (Maybe I could organize (manually or automaticallyby AI) all IFC Site/Building/Level

    much easier in Bricscad, when without VW's information)

     

    Ciao Zoomer, I don't think that you can: VW sees the document as a building. Also, you get into quite a construction for the IFC Export dialog: this does allow to export what's visible, but doesn't allow to store configurations, so you would have either to map very very carefully the storey names or re-list the needed levels in there each time.

     

    • Like 2
  8. 11 hours ago, halfcoupler said:

     

    Ok, so we all make a demonstration march to Lörrach ? 😆

     

    Yes! LOL

    11 hours ago, halfcoupler said:

     

    German support told me, serial numbers for VW2022 with dongle can't be generated at all ? So this is wrong ?

     

    Yes, this is wrong: there is support for the dongle in the main application. I have two licences for VW International version, which is exactly the USA version, only much more expensive. There is no reason whatsoever to limit them. 

    • Like 1
  9. Because, as a free lance BIM whatsoever, I could go to any office, plug my own dongle, swap the number and work for them. Now I cannot. 

    Because, as dongle user I could use it across ALL versions from the very beginning of the dongle age, and I did: I have machines for most versions, I can develop, recover your file forensically, do anything with VW like no-one out there. Now I can't: only 3 versions supported.

    Because, when on holiday in the remotest spot of the Italian Maremma, without even cell coverage, I could dive deep into whatever programming dream of mine. Now I can't, you have deinstall here and there first. Or you might be blocked.

    Because, as I have been using the E-version as beta tester for the last 13 years as well, and can tell you that all the totally cool-free-fancy stuff above mentioned simply isn't possible any longer

     

    And finally, because this limit is only in Germany: VW DIDN'T stop dongle support, only our otherwise much esteemed distributor did.

    They do a lot of good things. This is BAD.

    • Like 4
  10. Ciao Jeff, no. The wacom is more than Ipad + pen, even if the new apple pen 2 does have a very high quality. The size of the display is very large, the customisation nearly boundless. I could go on.

    Yes, it is plain luxus, but whatever...

     

  11. If you map zoom in to C and zoom out to V, then you can either

    • double-c or double-v --> you zoom by factor, I think OR
    • draw a marquee which will be zoomed in/out, if the first mode is activated

    that's the mode I prefer. It brings you just the right zoom on the right object.

     

     

    • Like 2
  12. On 7/2/2021 at 9:10 PM, zoomer said:

    I miss a Scroll Wheel, for those few Apps like VW, that don't offer missing-Scroll-Wheel

    key+button alternatives for Zooming.

    .....

    But if I would get the 3rd button, I think it would not work to enhance VW Zooming

    because I already tried to assign any driver function to one of my regular 2 buttons.

     

    But @_c_,

    what usage for the 3rd button did you have in mind ?

     

     

    Like you, I also sometimes miss the scroll wheel, but not in VW, where I always used the old keys C and V for zoom in and out. It is preciser, faster than the scroll wheel and far less taxing on the graphic card. Having a third button should help assigning them.

     

    These days I am nearly exclusively on Solibri and a third button is good there. Solibri is rather difficult as of the views, compels you to zoom in over and over again, and there is no customisation of the keys AND there are one thousand key variants for the tiniest actions. 

  13. It will be such fun!

     

    Vectorscript is very rewarding, it will give you power and endless brainfood.

    I bring Vectorscript code 'problems' for my long runs. There is nothing better for forgetting yourself for a couple of hours.

    • Like 1
×
×
  • Create New...