Jump to content
Benson Shaw

Prime number generator node

Recommended Posts

Thanks to help from a programmer/coder friend (Mr J), internet posts of python prime number generators, and tips on Community Board I was able to modify a Series node to become a Prime Number Generator with range inputs. Sample attached as a v1. (Note - I am totally not educated or capable in python or other scripting.  Dependent on others.)

 

Any comments, improvements or alternatives welcome.

 

Here is the prime generator python script from Scanftree.com

http://scanftree.com/programs/python/python-program-to-print-all-prime-numbers-in-an-interval/

 

image.thumb.png.94f2ce93ce4f9ef6e0140eb87f0287a9.png
 

 

 

 

The Standard Series node uses a List [ ] output.

Mr J and I could not make that work, so commented it out.

He tried .append instead which apparently works well.

See it in action in this thread:

 

Prime Series Node.vwx

Edited by Benson Shaw
oops! attached the vwx file with prime number node

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 

7150 Riverwood Drive, Columbia, Maryland 21046, USA   |   Contact Us:   410-290-5114

 

© 2018 Vectorworks, Inc. All Rights Reserved. Vectorworks, Inc. is part of the Nemetschek Group.

×
×
  • Create New...