Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dynamically selecting Corridor Regions

8 REPLIES 8
SOLVED
Reply
Message 1 of 9
Jeff_M
656 Views, 8 Replies

Dynamically selecting Corridor Regions

Attempting to mimic C3D's highlight each region as the cursor passes through it during selection of a region to edit. Not seeing how to accomplish this...any hints would be helpful.

 

Edited to add that I know it will involve using the Editor.PointMonitor event. What I don't know is how to determine which region the cursor is in and then, once I know that, how to get the region boundary in order to highlight it.

Jeff_M, also a frequent Swamper
EESignature
8 REPLIES 8
Message 2 of 9
Jeff_M
in reply to: Jeff_M

Brute force is the answer. Have it nearly working now after a few hours of testing.

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 9
Jeff_M
in reply to: Jeff_M

So what I have, works on corridor with a few regions. On one with a few hundred regions it is unbearably slow...back to the drawing board.
Jeff_M, also a frequent Swamper
EESignature
Message 4 of 9
joantopo
in reply to: Jeff_M

Hi jeff.

 

I would calculate the station (from your alignment) of your cursor,  then I would check every region (startregion station and endregion station) if my station is between them to determine the region properly.

Autocad C3D 2019 SP3, 2020 & 2021
Intel I9 9900K with frontal watercooler alphacool eisbaer 360 (original fans mounted in pull)- 3 fans Corsair 120 ML PRO in push.
MOBO Gygabyte Z390 Aorus Master- Corsair RGB Vengeance 64GB RAM (4x16) CL16
Nvidia Quadro RTX 4000
Samsung 970 EVO PLUS 1TB (unit C). Samsung 970 PRO 512GB (for data)
Power Supply: Corsair TX850M PLUS


Descubre mi programa VisorNET para Civil 3D:
https://apps.autodesk.com/CIV3D/es/Detail/Index?id=appstore.exchange.autodesk.com%3avisornet_windows32and64%3aes
Message 5 of 9
Jeff_M
in reply to: joantopo

Thanks, Joan. That's not quite what I'm looking at doing though. Here's a quick Screencast showing the naitive C3D region selection, and then my attempt at mimicing this selection process. You can see mine does work, but it is painfully slow....

 

 

Jeff_M, also a frequent Swamper
EESignature
Message 6 of 9
Civil3DReminders
in reply to: Jeff_M

I'd cache the regions of the corridor when the command is first called and then you'd be able to use multithreading to pull the correct region and not get stuck using Civil 3Ds single threaded API to return the value.

Message 7 of 9
Jeff_M
in reply to: Civil3DReminders

Thanks, Christopher. That's what I was doing, but I was using the BoundaryRepresentation managed wrapper to find IsPointInside. It turns out that this process is quite slow, at least in the manner in which I was using it. I've got another method working fairly well, but it is returning some false positives so still need to work on cleaning it up.

 

But, it's getting closer!

Jeff_M, also a frequent Swamper
EESignature
Message 8 of 9
augusto.goncalves
in reply to: Jeff_M

Hi,

 

Not sure if I can add... but what you mean by 'brute force'? Also, how are you reading the objects inside the PointMonitor event? Maybe we can just improve the current process you have...

Regards,



Augusto Goncalves
Twitter @augustomaia
Autodesk Developer Network
Message 9 of 9
Jeff_M
in reply to: augusto.goncalves

Thanks for responding Augusto.

By 'brute force' I meant iterating each baseline->region->applied assembly->link._calculated point to find the boundaries of each region (I do this once at the onset of the command). I then use the PointMonitor RawPoint and check if it lies within one of the polylines formed by the regions. If so, I highlight the region using a TransientGraphic with that polyline and show a small form with the Baseline-Region name.

 

I actually have a version of this working well now. Would've been nice to be able to tap into what C3D uses internally for this, if, for no other reason, to be able to keep my command looking like a 'normal' C3D command. Would've saved me a few days of research and testing, too.

 

 

Jeff_M, also a frequent Swamper
EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report