Welcome to the Onshape forum! Ask questions and join in the discussions about everything Onshape.

First time visiting? Here are some places to start:
  1. Looking for a certain topic? Check out the categories filter or use Search (upper right).
  2. Need support? Ask a question to our Community Support category.
  3. Please submit support tickets for bugs but you can request improvements in the Product Feedback category.
  4. Be respectful, on topic and if you see a problem, Flag it.

If you would like to contact our Community Manager personally, feel free to send a private message or an email.

Script for extruding a circle section between two points

Hi I'm looking for where to start for leaning how to write a script that extrudes a simple cilindrical section between two point, for a given (large) point list
Thank you

Comments

  • S1monS1mon Member Posts: 2,982 PRO
    Here's a simple FS which creates a circular sweep along a path.

    Here's another which will sweep a few different options along a path.

    Are you trying to make multiple discrete parts, or a single part which goes from point to point to point....? I think both of these will take curves or edges as inputs and will create one or more parts depending on if the inputs are connected or not.

  • ricardo_baptistaricardo_baptista Member Posts: 5 EDU
    Thank you S1mon

    Best regards
  • glen_dewsburyglen_dewsbury Member Posts: 782 ✭✭✭✭
    edited January 2023
    You might want to look at Frame function. I've been useing it for a lot of things lately. Not just structural shapes. Includes pneumatic hose lines.
    https://cad.onshape.com/documents/eeff86f87f2b3be9ae6915b8/w/c75821c5084576f01fba38b9/e/20afca98c6d27bdccb4b880f
  • ricardo_baptistaricardo_baptista Member Posts: 5 EDU
    My solution was to use the fcylinder function. But I would now like to elaborate.
    How can I create an array of several x,y,z points, and use them to create several cylinders?
    Is it possible to read this array froma file?

    Thank you

    Best regards
  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    Am I right to guess that you're wanting to generate lists of points in a spreadsheet or something, then create cylinders between them? Does each point have an explicit pair, or should it make a cylinder from the current point to the next on in the list or what? You can read a csv file, and from there use a for loop to iterate over the points and make your cylinders.
    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    Here's a real quick example. In your case, you wouldn't have two queries for two sets of points, you'd just import them, or specify them some other way.
    https://cad.onshape.com/documents/2a575063c8b4392a1cbe7a49/w/93079b2e8300196f4e775728/e/ee2303bd27eb61587dc59488

    Evan Reese
  • EvanReeseEvanReese Member, Mentor Posts: 2,135 ✭✭✭✭✭
    I got an itch to try this out last night. I was able to generate a cube volume randomly populated with points, then connect them with cylinders in a single feature. Anyway, if you can get clear on exactly what you're trying to do, I can be more helpful, but from what I understand now about your goals, it should totally be possible.

    Evan Reese
  • mahirmahir Member, Developers Posts: 1,307 ✭✭✭✭✭
    I got an itch to try this out last night. I was able to generate a cube volume randomly populated with points, then connect them with cylinders in a single feature. Anyway, if you can get clear on exactly what you're trying to do, I can be more helpful, but from what I understand now about your goals, it should totally be possible.
    Instead of finding a needle, you generated the haystack  :D
Sign In or Register to comment.