Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Vision for NET
»
Nevron Diagram for .NET
»
How to find specific NShape ID in a document with lots of shapes?
How to find specific NShape ID in a document with lots of shapes?
Post Reply
How to find specific NShape ID in a document with lots of shapes?
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
Nevron Support
Nevron Support
posted 10 Years Ago
ANSWER
Post Details
Group: Administrators
Posts: 3.1K,
Visits: 4.2K
You can try the following method:
document.GetElementFromId(_measurementPoint.ID);
Internally it uses a dictionary, so it should be much faster and efficient.
Best Regards,
Nevron Support Team
Reply
Like
0
Hans Henrik Friis Pedersen...
Hans Henrik Friis Pedersen...
posted 10 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 28,
Visits: 136
Hi,
I'm using the following code to loop through all shape in a document (using 2 nested foreach loops) and locate a shape with a specific ID. Isn't there a easier and more efficient method? A Find method?
NNodeList nodes = document.Descendants(NFilters.TypeNShape, -1);
foreach (var shape in nodes)
{
foreach (MeasurementPoint _measurementPoint in this._measurementPointList)
{
NShape shp = (NShape)shape;
if (shp.Id == _measurementPoint.ID)
{
//more code here...
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search