Filtering points by distance

[see previous discussion at How to find and edit cogo points by description?]

I am trying to expand my script and have another question. I am comparing 2 points and am now trying to get the program to insert a block at a point if the distance is greater than or equal to 5. See image below.

TIA, Paul
msd asbuilt point data_ver3.dyn (37.9 KB)

Add block is the “easy” part but what do you want to do if the distance is less than 5 and the result is “False”
I also added some changes to you script if it helps
msd asbuilt point data_ver3_1.dyn (61.8 KB)

Hi Patrick,

Do nothing if the distance is less than 5. Only insert a block if the point is 5 or greater. Thanks again for all your help. When I have some free time today I will check out your improvements.

Paul

Not sure how to deal with the case if distance is less than 5.
Maybe @Anton_Huizinga or @jacob.small know how to do?
Regards,
Patrick

1 Like

3 Likes

of course :flushed:… Why make it harder than it needs to be?
I thought your where sick @mzjensen, hope you feel better now.
KR
Patrick

I may have jumped into the deep end here. I tried both your suggestion, but I am now getting this error:

any ideas what arguments I am missing?

I got it work! I changed the BlockReference.ByCoodinateSystem to BlockReference.Create. I don’t really understand the difference, but I am happy it works.

image

In the BlockReference.Create node, you’ll notice inputs for position (i.e., insertion point), normal (i.e., which direction is considered “up”), rotationDegrees (i.e., rotation around the defined normal vector), and scaleFactors (i.e., XYZ scale). These are all things that you have to specify when you insert a block reference in AutoCAD normally, you just may not think about it. In Dynamo, those things become explicit.

The BlockReference.ByCoordinateSystem node seems much different, but it’s really just doing the same thing. The position, normal, rotation, and scale inputs are all combined into the coordinateSystem input. What’s a coordinate system? In Dynamo speak, it’s a cartesian coordinate system that has all of those same things: an origin point, and then three orthogonal vectors for the X, Y, and Z axes.

Have a look at the samples in the Dynamo Primer - I think they’ll help clarify this for you.

So in summary - both nodes do the same thing, just with different inputs for different situations :slight_smile: