However, after trying this I get a prompt box to select SetX, SetY or SetZ. How to pick up an option from the list using python? Could you please help with this?
This is really nice and helpful. But one problem I face is that I need to change the x value in the code to set points from time to time since I have to set points at different x values.
So, I prefer the command that asks me to select the point/ curve which x value I would like to use.
If you want to set a point’s coordinate directly, you can address each coordinate (X, Y, Z) of a point separately and assign a new value. So, if you wanted to set all the points in a list of points to 0 in Z for example, it would look like this:
for pt in pts:
pt.Z=0
That’s it, simple. You can set the Z value as fixed in the script, or ask the user for it with rs.GetReal().
Not sure what you are trying to do, but this may fail or produce bad objects for some types of objects - for example an X-axis-aligned 3D boxlike structure or a polycurve that has elements that are parallel to the X axis in it.
If you are trying to “flatten” curves, then you can perhaps limit the choice in GetObject() to curves (4); or perhaps you are trying to align stuff and not necessarily flatten things?
Thank you. I have got your points. I am an amateur in python scripting. I will try to develop it. Anyway, I am facing a problem with the existing code. It can not select block instance reference insertion point. Could you please tell me how to select reference the insertion point as well?