Jump to content

Grzegorz Krzemien

Distributor
  • Posts

    91
  • Joined

  • Last visited

Posts posted by Grzegorz Krzemien

  1. Hi,

    I have a question about the If node. In my example, somehow If node passes through an object despite the fact the Boolean condition is False. This network should work "if condition is True then create an extrusion and move it to the right, if condition is False do nothing".

    As a result if value is True, indeed it creates an extrusion and moves an object (Green in the picture). If value is False, "IF" node returns "0", but later extrusion sees base rectangle and passes it through, but not performing extrusion and then moves rectangle (RED in the picture).

     

    Anyone has an idea why IF node works like this?

    File is VW2023.

    If node query.jpg

    test_if_hk.vwx

  2. Hi all,

    I've tried to create a network that distributes symbols along path, but at the same time it also places them on the DTM. I created a simple node to place objects on a DTM and whole network works fine until I try to covert this network into Marionette Object.

     

    For a path I tried to use Control Geometry node, but it looks like this node always moves selected object to the origin using centre (weight) point as a reference. As a result whole network does not read actual location (XYZ values) of the selected object, but it calculates all further operations using relocated to the origin values. As a result I cannot get the proper distribution on the DTM, since DTM is not located in the origin.

     

    Picture A1 - base result. Only 2 last objects are moved on the DTM, but with wrong Z values.

    Picture A2 - result when Marionette object is moved to the origin. It clearly shows that only the last 2 object are "on" the DTM, with correct Z values, which indicates what I've mentioned above - network uses relocated path instead of real location.

    A1.jpg

    A2.jpg

    Obj on DTM.vwx

  3. Hi all,

    I have two questions about how path extrude and contour nodes work. I tried to create a network that creates a set of extrusions (wood beams) based on 2 NURBS and encountered two issues:

     

    1. 1st and last extrusion along path works fine, it creates extrusions in correct orientation. All in between extrusions are rotated 90deg. Rebuilding curves to 3D polygons do not help. Is there a reason for this behaviour? (green in the attachment) 

    2. The result of using Contour node on loft surface is a set of curves, but why the last one is always created in the opposite direction compared to the others? (red in the attachment) Is there an easy way to align them all in one direction?

    A1.jpg

    1.vwx

  4. @jmhanby

    I'm using Prusa Slicer for prints and if needed, I often scale model directly in the slicer.

    My attachment shows a floor from my project, exported as stl without any transformations (so walls are walls, windows are windows etc) and then scaled directly in the slicer. I've had no issues yet.

    Zrzut ekranu 2023-02-22 172810.png

    • Like 1
  5. @KIvanov My file was only an example, that worked yesterday, but I was able to break it today.

    It looks like there is a problem with publishing a worksheet to pdf. If " reset all plug-in objects that require a reset prior to exporting" option is on, Data tags are being disconnected. It this option is off, everything works fine.

     

    According to the thread below it should be fixed by now.

     

    Att_2.jpg

    DataTag inside symbol BROKEN.pdf DataTag inside symbol BROKEN.vwx DataTag inside symbol.pdf DataTag inside symbol.vwx

  6. Hi,

    I'm trying a new thing - a symbol (e.g. bathroom) build from set of equipment (also symbols e.g. sink, toilet bowl, bath etc.). I tried to use a data tag that reads name of a symbol to name equipment inside the main symbol (whole Bathroom). But for some reason in random moments all data tags located inside the symbol disconnects from objects.

     

    I've created a simple example of what I mean using 2D objects.

     

    General question - is it safe/tested workflow to use data tags inside symbols?

     

     

    DataTag inside symbol.vwx

  7. GOT IT. The correct combination of quotes is:

    vs.ForEachObject(RectSort, "PON='Space'")

    Full script:

    import vs
    
    def SpaceSort (h):
    	area = vs.Space_GetNetArea(h)
    	if area < 10: #value in m2
    		vs.SetClass(h, 'RED')
    	if area >= 10: #value in m2
    		vs.SetClass(h, 'BLUE')
    	
    vs.ForEachObject(SpaceSort, "PON='Space'")

    Thanks for help!

  8. Tried all of these combinations:

    vs.ForEachObject(SpaceSort, PON='Space')

    vs.ForEachObject(SpaceSort, (PON='Space'))

    vs.ForEachObject(SpaceSort, ((PON='Space')))

    but all of the fails.

    First version gives error that suggests that there are no keyword arguments in vs.ForEachObject(), second and third that syntax is wrong.

     

    Script error 1.jpg

    Script error 2.jpg

  9. Managed to do this in a different way:

    First - same idea, but with Rectangles:

    import vs
    
    def RectSort (h):
    	area = vs.HAreaN(h)
    	if area < 10000000:
    		vs.SetClass(h, 'RED')
    	if area >= 10000000:
    		vs.SetClass(h, 'BLUE')
    	
    vs.ForEachObject(RectSort, "T=RECT")

    Works great.

    I tried to recreate this, but instead of using rectangles, I wanted to use Spaces.

    import vs
    
    def SpaceSort(h):
    	area = vs.Space_GetNetArea(h)
    	if area < 10000000:
    		vs.SetClass(h, 'RED')
    	if area >= 10000000:
    		vs.SetClass(h, 'BLUE')
    	
    vs.ForEachObject(SpaceSort, PON='Space')

    But it fails. There is something wrong with criteria I think, but I don't know what.

    I couldn't find "Space" object on this page:

    https://developer.vectorworks.net/index.php/VS:Search_Criteria#Search_Criteria_Sub_Types

    so I assume, I create a criteria in a wrong way.

  10. @Pat Stanford, thanks

    So I think I don't really get the "handle" idea.

    I tried to write a similar code for rectangles:

    RectCount = int (vs.Count('Rect'))
    RectList = []
    
    for i in range (RectCount):
    	obj = vs.GetObject((T=RECT)) 
    	area = vs.HAreaN(obj)
    	RectList.append([obj,area])
    	
    for j in range (len(RectList)):
    	if RectList[j][1] < 10.00:
    		vs.SetClass(RectList[j], 'RED')
    	elif RectList[j][1] >= 10.00:
    		vs.SetClass(RectList[j], 'BLUE')

    but I don't know how to describe a criteria to search for specified object (e.g. rectangle).

  11. Hi all,

    I'm pretty new to direct scripting in Vectorworks, but always wanted to learn. As a first attempt I wanted to create a simple script that searches for "spaces" and assigns them to appropriate class depending on Net Area. In my file there is an example that should assign Spaces with area <10m2 to the RED class and rest to the BLUE class.

    But, obviously, it fails since I' pretty green in this Area 🙂 Can someone give me a hint, not the solution, something that will help me to write this script?

    Space sorting script.vwx

  12. Hello,

    I have some problems with Tile fills in my slabs. I tried to create own Tile fillings for my slabs, but they all fail in sections. As I noticed even built-in Tile fills do not work properly - they are moved, not aligned etc. I tried many combinations of settings, but still either I am missing something or it just does not work.

    Picture and file in attachment.

    Slab test.jpg

    Slab test.vwx

  13. @Tom W. I want to be able to change slope values. In the file I have sent there are 3 stages of my work - 1. Base slab. 2. Slab with drains in the corners. 3. Slab after connecting all drains together.

    My problem is that when I am connecting drains together, VW generates 5,2% slopes every time - no matter how slopes were described before connecting drains. I assume that it is somehow connected with saddle settings, but whenever I want to change saddle value Vectorworks crashes.

    So I have no idea if I am doing something wrong, or there is another way to create this kind of roof from slab.

    Thank you very much for your time :).

×
×
  • Create New...