Jump to content

htranbos

Member
  • Posts

    29
  • Joined

  • Last visited

Reputation

3 Neutral

Personal Information

  • Location
    United States

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Design layer and it is set to 300 DPI. I zoomed in for the screenshot so you can see the jagged edges.
  2. Hi, I export a png rendering from Vectorworks 2023 with a transparent alpha channel. When I open it in photoshop and place it over a black gradient background. I can see jagged edges around the image. Does anyone know how to fix this? Thanks
  3. Thanks Pat and Raymond!! In that case, I think the documentation is a bit misleading. Instead of saying FSActLayer & LSActLayer return the first and last SELECTED objects. It should say FSActLayer & LSActLayer return the first and last drawn objects in the document. Is there a function to return selected objects in order, depending on how each object is selected on screen?
  4. Hello, I have 2 rectangles in my document. According to VS Python documentation: - Function FSActLayer returns a handle to the first selected object on the active layer. - Function LSActLayer returns a handle to the last selected object on the active layer When I select the left object first and the right object second, I receive the following alerts (as shown in attached screenshot) However, when I change the order of selection, by selecting the right object first and the left object second, I still receive the same alert. Wouldn't h1 & h2 order change dynamically based on whether it is selected first or last? I hope my question makes sense. Thank you! h1 = vs.FSActLayer() h2 = vs.LSActLayer() vs.AlrtDialog(h1) vs.AlrtDialog(h2)
  5. Hello all, I finally made it to work. In order for the above code to produce the correct result, you need to put each search criteria inside a () like below. crit_string_1 = "(SEL=TRUE) & (T=NURBSCURVE)"
  6. @twk I tried your suggestion placing criteria strings in variables. Each method works and produced no error. However, the output is still 0 instead of 1. For this test, I only have 1 Nurbs curve object in the scene and it is selected. The output of this script should be 1 instead of 0. I don't know why I can't get it to produce the correct result. myList = [] def sel(h): myList.append(h) crit_string_1 = '"SEL=TRUE" & "T=NURBSCURVE"' vs.ForEachObject(sel, crit_string_1) vs.AlrtDialog('Number of selected objects: {}'.format(len(myList)))
  7. Thanks @twk. I will try SEL and see if it the result is correct.
  8. I am able to make the script run without any error message.... but the output of this code should be 1 not 0. I don't know what I did wrong. myList = [] def sel(h): myList.append(h) vs.ForEachObject(sel, "(T='NURBSCURVE') & (VSEL=TRUE)") vs.AlrtDialog('Number of selected objects: {}'.format(len(myList)))
  9. It works if I break down the code like below: myList = [] def sel(h): myList.append(h) vs.ForEachObject(sel, "T=RECT") vs.ForEachObject(sel, "T=NURBSCURVE") vs.AlrtDialog('Number of selected objects: {}'.format(len(myList)))
  10. Hi Pat, I tried your suggestion and got the following error message. I didn't know about the criteria builder inside VS editor. This is awesome. Thank you!!
  11. I am making a simple python script to calculate the number of items added to a list. I have multiple rectangles and nurb curves in the scene. My script is below. According to VS:Search Criteria, multiple search criteria are created using the & operator to chain individual search criteria terms. However, I got the unsupported & operator error. Does anyone know how to perform multiple search criteria with Python script? Thanks fam! myList = [] def sel(h): myList.append(h) vs.ForEachObject(sel, "T=RECT" & "T=NURBSCURVE") vs.AlrtDialog('Number of selected objects: {}'.format(len(myList)))
  12. @JBenghiat Finally I am able to make it to work. Below is what I did: h = vs.FSActLayer() upi = vs.GetPrefReal(152) #Calculate unit per inch preference thickness = 25.4*upi*2 #Converting mm to in (1in = 25.4mm). This statement set thickness to 2" vs.CreateShell(h, thickness)
  13. @JBenghiat Thank you! I did not realize there is a separate forum for Python Scripting. I started to mess around with units per inch preference but haven't been able to make it to work. I will play around with it some more.
×
×
  • Create New...