Select profile of 2d drawing

Can someone give me a script to select the outside profile of a 2d part?

Hi @Harold1,

Can you upload a .3dm file with the part?

Also, when you say “select” do you want to this interactively or automatically?

As always, the more details you provide, on what you are trying to do and why, can speed up the process of providing an answer.

Thanks,

– Dale

This question relates to the other post. I was on vacation. Sorry for the delay in replying. Yes, I would like too automatically select the profile and get total inches then select all the holes and get total inches.

Test.3dm (49.6 KB)

Test.dxf (10.1 KB)

Hi,

I attached a video and a DXF file of what I want to automate. I would like to do this for every DXF file in a folder.

Hi @Harold1,

Attached is version 1.

Harold.py (3.6 KB)

To try, just use Rhino’s RunPythonScript command.

– Dale

Works great thank you for your help.

Hi Dale,
I’m trying to learn as much as possible about scripting so i don’t have to ask so many questions.

Can i ask you a couple of questions about the script you wrote for me?

Of course.

– Dale

Dale,
Thanks. I been looking at the script and i been trying to figure out how everything works. Can you break down the line of code in below picture? I been looking on the internet and can’t find anywhere that can teach me what you have done there. I attached a script i just made to enter some basic info into a file. so, you can see how little i know. I’m just starting out i am using the internet for samples.


Cut-Shop-changes.py (4.3 KB)
test.3dm (616.5 KB)

Hi @Harold1,

With Python, you can return multiple values from a function by separating them with commas.

The Python language passes all arguments by-value. There is no syntax to indicate that an argument should be passed by-reference like there is in .NET languages like C# and VB.NET via the ref and out keywords.

IronPython supports two ways of passing ref or out arguments to a method, an implicit way and an explicit way.

In the implicit way, an argument is passed normally to the method call, and its (potentially) updated value is returned from the method call along with the normal return value (if any). This composes well with the Python feature of multiple return values.

More…

Hope this helps,

– Dale

Thanks. I will see what i can learn