htranbos
Member-
Posts
29 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Articles
Marionette
Store
Everything posted by htranbos
-
How to draw (lines or walls) parallel to another on the fly?
htranbos replied to MarCur's topic in General Discussion
This works for me. Thank you! -
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?
-
Thanks so much Pat!
-
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)
-
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)"
-
@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)))
-
Thanks @twk. I will try SEL and see if it the result is correct.
-
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)))
-
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)))
-
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!!
-
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)))
-
@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)
-
@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.
-
I am writing a small script to create Shell Solid for a selected object. The current Document Settings units is in decimal inch. In the below script, I want to create a shell solid at 2" thickness. However, after running the script, the shell object thickness is at .079". Is there a way to convert REAL number to the correct unit in inches? h = vs.FSActLayer() vs.CreateShell(h, 2) Thanks
-
@Kevin Allen Thanks Kevin. I just tried that, and it worked. It's not very intuitive but it does the job.
-
I have a scene setup with multiple different cameras. Is there a way to use batch render in Vectorworks to export each camera view as an image in one go? Thanks!
-
I cannot import from mtexture. I am using Vectorworks Fundamentals 2022 running on PC. Do you know why? Please see attached screenshot! Thanks.
-
Auto update texture when an image is changed
htranbos replied to htranbos's question in Troubleshooting
@Elite Exhibits Yes, I have that script already. It is super helpful. -
Auto update texture when an image is changed
htranbos replied to htranbos's question in Troubleshooting
Wow! Thanks @Jesse Cogswell for a comprehensive response. I will give this a try. -
Is there a way to make Renderworks Texture automatically update when an old image file is override by a new image file. In some other software such as 3D Studio Max, texture maps are reference by default. This makes updating texture so much faster. I am just curious if you can do something similar in Vectorworks. Thanks,
-
Vectorworks keeps selecting the wrong texture. PLEASE HELP!
htranbos replied to htranbos's topic in General Discussion
@Elite Exhibits Hi Peter, apparently, if I apply texture by dragging it from the resource browser, it works every time. Only when I try to change the texture via Object Info panel, that's when the problem occurs. -
Vectorworks keeps selecting the wrong texture. PLEASE HELP!
htranbos replied to htranbos's topic in General Discussion
@Kevin K Thanks for your response. It's not just a file. It happens to every file I have. I will try to capture it next time it happens and share it here. It's hard to do when it happens randomly. -
Vectorworks keeps selecting the wrong texture. PLEASE HELP!
htranbos replied to htranbos's topic in General Discussion
@Elite Exhibits I use Obj Info to select the texture to apply.