Author Topic: Mimic the Civil3D function to color the selected path  (Read 1223 times)

0 Members and 1 Guest are viewing this topic.

huiz

  • Swamp Rat
  • Posts: 825
  • Certified Prof C3D
Mimic the Civil3D function to color the selected path
« on: September 18, 2014, 04:55:21 AM »
Is it possible to mimic the way Civil3D colors the path while selecting, using a jig? And if so, does it not use a lot of resources to continuously calculate a part of a polyline while moving around?

In Civil3D, for example, if you split a Parcel, you can select the path along a Parcel line and while dragging the mouse, you see a colored line along the Parcel lines from the first selected point to the place where the cursor is, untill you click.

I know it is possible to split a polyline with Curve.GetSplitCurves() but is that the way to get a part of the polyline and show it as a jig? Or are there smarter functions to do this?





The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

Gasty

  • Newt
  • Posts: 89
Re: Mimic the Civil3D function to color the selected path
« Reply #1 on: September 19, 2014, 12:06:29 AM »
Hi,

I'm not sure as I'm not a C3D user or developer, but you can try with a combination of point monitor, transient graphics, and some clever treatment of the polyline segments. The are good examples of point monitor and transient graphics out there, just google a little.

Gaston Nunez

n.yuan

  • Bull Frog
  • Posts: 269
Re: Mimic the Civil3D function to color the selected path
« Reply #2 on: September 19, 2014, 04:02:18 PM »
I do not use Civil3D, therefore not very sure what the feature you are referring does. But I can guess what you want and just did a quick enhancement to one my existing piece of code. Instead of post incomplete portion of that code, I though it would be better to post it as whole in my blog.

Here is the link:

http://drive-cad-with-code.blogspot.ca/2014/09/moving-mouse-cursor-to-trace-polyline.html

HTH

huiz

  • Swamp Rat
  • Posts: 825
  • Certified Prof C3D
Re: Mimic the Civil3D function to color the selected path
« Reply #3 on: September 20, 2014, 12:55:20 AM »
Wow Norman! It is exactly what I described! Thank you very much for this code!

I would be happy already with some tips, but full working code is really cool! :-) Saves me a lot of time to implement.
The conclusion is justified that the initialization of the development of critical subsystem optimizes the probability of success to the development of the technical behavior over a given period.

insmur

  • Mosquito
  • Posts: 1
Re: Mimic the Civil3D function to color the selected path
« Reply #4 on: February 15, 2019, 05:06:10 PM »
Firstly , thanks your code, it is real awesome but I have a question.

It is working only line, what about arc?

n.yuan

  • Bull Frog
  • Posts: 269
Re: Mimic the Civil3D function to color the selected path
« Reply #5 on: February 20, 2019, 11:53:29 AM »
Well, you need to update to code (the "DrawTransientGraphics()" method in my article) to draw the transient graphics correctly. For straight line/segment, it is easy, as the code shows; but it is arc/curved segment, you need to figure/calculate the arc/curve's radius and calculate the arc/curve's length according to current cursor location. It should be a simple math work, I suppose.