I don’t mind a quick look if you can post a sample file?
Thank you so much Mark, that would really help. How can i send it to you, the file size is just over the limit of 8mb to post here
WeTransfer, box, onedrive, dropbox, google drive, etc… all work. Just make sure the link isn’t behind an authentication requirement (open to anyone with the link).
Hi Mark,
please find the files below:
Thanks so much!
Thanks, wasn’t thinking
So, from what I can see you are feeding 5 references, but you want 10 spot dims, 2 for each surface… so I did this… It seemed to work…
Good morning @Mark.Ackerley - Thanks very much for taking a look!
Where did you add this information if I may ask?
The issue that I am experiencing is with the bottom stream of data, which doesn’t use any reference’s to place the spot elevation.
Sorry I think I should add, the issue is only with piping that is insulated.
Ok, that was with the top stream, the bottom one I had to rewrite a lot off the nodes as i stay away from python 2.7… is there a reason why you’re not using the same node for both streams? they’re both using references to make the spot dim?
At the time of creation, that was just what was working for me. The two streams signified two different approaches. I wasn’t using the reference method for both streams, I was using it for the top, and then the bottom stream was the approach of grabbing the pipe location, translating the curve down, extracting the points and using that method. I couldn’t get one method to deliver 100% results, so I started trying different approaches.
In the python code, I would suggest you to update this line:
except:
elementlist.append(None)
to
except Exception as e:
elementList.append(e)
This will give us the reason behind the null value. You can keep using the package node and just implement the changes to its python node.
This is my demo for one element and it is working for any point on the pipe surface :
Hi @emrullah.yildiz - Thanks for the response.
After making the suggested changes, the node reports this info.
- ‘NoneType’ object has no attribute ‘GetReference’ *
It works for all end points, but doesn’t get the start points for some reason…
Firstly,
the problematic line is ref = refintsec.FindNearest(pt,intsecvec[i].AsPoint().ToXyz()).GetReference()
.
Secondly, in my opinion the problematic input is intsecvec[i]
. Apparently, there is no reference found in that direction starting from the point.
Option 1
You can try to remove Vector.Reverse node in the package node and see what happens. If it creates spot elevations for your start points, you can update that part by reversing the vector if the result of ref is null in Python code.
for pt in pts:
view = views[i]
pt = pt.ToXyz()
refintsec = ReferenceIntersector(isoview)
refintsec.TargetType = FindReferenceTarget.All
direction = intsecvec[i].AsPoint().ToXyz()
ref = refintsec.FindNearest(pt, direction)
# Check if ref is null and reverse direction if necessary
if ref is None:
direction = direction.Negate()
ref = refintsec.FindNearest(pt, direction)
Option 2:
You can try to use the python code that I shared and create your own references for the python inputs. You just need to work with points and the surface that you want to attach the spot elevation. If you would like to improve yourself in Python, I suggest this option and create your own code by checking the results step by step with OUT = result
.
Hi @emrullah.yildiz - Thanks so much for the detailed feedback, appreciate that!
Yes, unfortunately Python is not a strong point for me, but I will have to make something work to get this right, so I will have to look around and try put something together. Thanks very much again