How to prune duplicate points with tolerance in python?

Is there any revitapi method to achieve this?
or can be achieved by this?

import numpy as np
from scipy.spatial import cKDTree

in cpython?

@newshunhk ,

Do you have already installed the module? - numpy

I struggle to install Sympy correctly :confused:

This should work: Dynamo Dictionary

In python that’d be something like
prunedPoints = Point.PruneDuplicates(originalPnts, 0.1)

Assuming you’re using CPython3, and have followed the instructions here: Customizing Dynamo's Python 3 installation · DynamoDS/Dynamo Wiki · GitHub

Which step are you stuck on?

when i run my path it is wrong, i think i don`t have this window
2022-06-30_13h39_08

Hi, I decide to code it without dynamo

no :frowning:
I can’t import numpy yet :frowning:

Directly placing modules is likely going to cause some issues; best to utilize the pypi tool.

Can you show what happens when you open the start menu and search for ‘cmd’ ? GIF or screen recording would be best.

2022-06-30_16h25_59

2022-06-30_16h26_30

python38.zip
.

Uncomment to run site.main() automatically
import site

2022-06-30_16h27_13

in the discription the use a other window

This will be a lot more work to manage as not only will you need to get these files onto your system following the link I posted above, but you’ll also have to manage the deployment thereof.

The Revit API does have the capability to compare XYZs in terms of “almost being equal to”, with this method: IsAlmostEqualTo Method (XYZ, Double). So you can pop a point out, test all other points in the list for almost being equal and remove them from the list if they return true, otherwise continue on. Repeat that list until the original list of XYZ values is 0.

Not the most effective by any means (a means of grouping the XYZ values into smaller groups would help), but it’d do the trick.

I may be seeing this wrong, but you appear to be working in a visual studio window instead of the windows command prompt; not sure that’ll do the trick as it’d configure your development environment but perhaps not the Dynamo one.

@jacob.small , i have no windows comment prompt … can i simple install it?

If you open the start menu and type “cmd” what do you see for options? Sadly I’ve got a bit of a localization handicap here.

2022-06-30_16h37_14

i have just these, is there a shortcut maybe? or via taskmanager? @jacob.small