Jump to content

Is it possible to auto extend or trim 2 different polylines to meet at the intersection at different elevations?


Alexv

Recommended Posts

Hi everyone, I just joined this community recently and I want to say a big thankyou to y'all for sharing your knowledge and providing help to others. I greatly appreciate it and I have used a dozen lisps posted on this forum. 

 

I'm using Civil 3D and here's my question: Is it possible to extend or trim 2 different polylines to meet at the intersection that are on different elevations? For example, Line 'A' has an elevation of 50, and Line 'B' has an elevation of 80. And I want both lines to meet at the intersection point (from top Plan view) while maintaining their elevation. So in 3D/model view, Line A would be lower than Line B. 

 

So far, I have been using the Extend command to extend Line A to Line B, and then repeating the same procedure for Line B to Line A. This is a repetitive task that I do for hundreds of lines, I hope there's  a solution where I can click on Line A and then click on Line B and both lines will automatically extend (or trim) to meet at the intersection (as observed from the top Plan View). The Fillet command doesn't work for non-coplanar lines (lines with different elevations). 

 

Thankyou for your time.

example.PNG

Edited by Alexv
Link to comment
Share on other sites

If you set the system variable EDGEMODE to 1, then you should be able to click on the two lines to extend them.

 

When starting EXTEND,  do not select boundary edges - just press enter, then click on line A then line B and they should extend to the intersection point.

  • Thanks 1
Link to comment
Share on other sites

 

 

@eldon This is exactly what I needed. I have been using the Extend tool and I didn't know about this trick. Thanks heaps. I greatly Appreciate it. 

 

@tombu Thanks Tom, that's very helpful, I didn't know about this stuff until now.

 

I have one more question that is unrelated to Extending lines and I'm not sure if I should start a new thread for it. Please advise if I should create a different thread for the following question.

 

I'm using Cogo points in Civil 3D that allows you to input a description for each Cogo point. So, Is it possible to connect the Cogo points together via Line or polyline based on their description? For example, all the points with the same point description ' Foot Path' joins together automatically? Please see attached screenshot. 

 

Civil 3D has a Surveying Database system that requires you to create a new survey database, import the Cogo points into the database to convert them to Survey points and then it'll string the points (with the same description) together. I find that method hardly inflexible and difficult to work with because the survey figure (the survey version of polyline) isn't easy to work with compared to the line and polyline. Any modification to the survey points or figures require you to update the survey database to reflect the change. 

 

Thanks again and have a good day :)

 

example2.PNG

Link to comment
Share on other sites

1 hour ago, Alexv said:

I have one more question that is unrelated to Extending lines and I'm not sure if I should start a new thread for it. Please advise if I should create a different thread for the following question.

 

I'm using Cogo points in Civil 3D that allows you to input a description for each Cogo point. So, Is it possible to connect the Cogo points together via Line or polyline based on their description? For example, all the points with the same point description ' Foot Path' joins together automatically? Please see attached screenshot. 

 

Civil 3D has a Surveying Database system that requires you to create a new survey database, import the Cogo points into the database to convert them to Survey points and then it'll string the points (with the same description) together. I find that method hardly inflexible and difficult to work with because the survey figure (the survey version of polyline) isn't easy to work with compared to the line and polyline. Any modification to the survey points or figures require you to update the survey database to reflect the change. 

 

Thanks again and have a good day :)

Reasons it's best to have the Survey crew create all the linework in the field:

1. They were actually there! Nothing worse than guessing what was actually out there in the field. We shouldn't have to go out to the sites to figure out what we're drawing.

2. Feature lines from field codes draw curves smoothly, accurately and are able to carry elevations as breaklines. Creating a surface that reflects curbs at an intersection would be impossible without them.

 

Our crew isn't perfect so I'll show them the drawing after reducing it to see if it needs to be modified. They put in the wrong codes requiring them to be modified and re-reduced but the results are what matters. Even if I had to add all the linework coding I'd still do it rather than drawing lines.

  • Like 1
Link to comment
Share on other sites

6 hours ago, Alexv said:

 

 

@eldon This is exactly what I needed. I have been using the Extend tool and I didn't know about this trick. Thanks heaps. I greatly Appreciate it. 

 

@tombu Thanks Tom, that's very helpful, I didn't know about this stuff until now.

 

I have one more question that is unrelated to Extending lines and I'm not sure if I should start a new thread for it. Please advise if I should create a different thread for the following question.

 

I'm using Cogo points in Civil 3D that allows you to input a description for each Cogo point. So, Is it possible to connect the Cogo points together via Line or polyline based on their description? For example, all the points with the same point description ' Foot Path' joins together automatically? Please see attached screenshot. 

 

Civil 3D has a Surveying Database system that requires you to create a new survey database, import the Cogo points into the database to convert them to Survey points and then it'll string the points (with the same description) together. I find that method hardly inflexible and difficult to work with because the survey figure (the survey version of polyline) isn't easy to work with compared to the line and polyline. Any modification to the survey points or figures require you to update the survey database to reflect the change. 

 

Thanks again and have a good day :)

 

example2.PNG

ARE YOU USING CIVIL 3d 

Or auto cad

And

Attached example drawing 

  • Like 1
Link to comment
Share on other sites

We have been using CIV3D for years and always auto strung the strings, we have around 270 codes in the "Description key sets". Some of these projects have in excess of 10,000 points.

 

You just need a DWT that has the keys set up in it, there are basically 2 a numeric or a Alpha key set with a few that are both TR6 Tree 6m dia. 

 

Do you have access to a DWT that is set up ? If not we need to know what your codes look like. Ask who you bought the Civ3d from they should have some.

 

Ok now for the real big news, in CIV3D you can export the Description keys but you can not import, so I wrote one it reads a excel csv with all the details and makes description keys.

 

image.thumb.png.6e550f0673640792a326e03db27313f6.png

 

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

@tombu Thanks for the reply. Just to clarify, I'm not working with survey field data. I have to manually put in each coordinated Cogo point (from old plans) and then join them together. Hence I'm asking if there's an easier way to join Cogo points together based on their assigned point description.

 

@BIGAL Thanks for the reply. Yes, I have set up a point description system for other things that automatically change point symbol based on its description. Though the point description function doesn't join points together into a line or polyline. 

 

@hosneyalaa Thanks for the reply. I'm using Civil 3D to create the Cogo points and assigning each Cogo point with a description. So I wonder if it's possible to join the Cogo points together (points with the same description) without using the survey database's 'line work figure', which as I have pointed out - isn't intuitive and not easy to work with.

 

Currently, I have to use the polyline tool to snap to each Cogo point to form a line. That Or I'll have to create a new survey database to connect the points together. By importing the Cogo points into the survey database to convert them to survey points, which would create a survey duplicate of all the points. And if were to modify the Cogo points, I would need to re-import the Cogo points back into the survey database again to update the figure line work.

 

 

@hosneyalaa Here's the example Civil 3d point file. Please see attached file. Thanks!

 

Thanks again everyone for your replies. Have a good day.

example.dwg

Link to comment
Share on other sites

 

hi 

try this

 

 

(defun c:testjionRawData  (/ % C3D C3DDOC ENAME1 PNTNUMS POINTS RAWDATA)
  (vl-load-com)

  
  (defun getC3D ()
    (vl-load-com)
    (setq C3D (strcat "HKEY_LOCAL_MACHINE\\"
		      (if vlax-user-product-key
			(vlax-user-product-key)
			(vlax-product-key)
			)
		      )
	  C3D (vl-registry-read C3D "Release")
	  C3D (substr
		C3D
		1
		(vl-string-search
		  "."
		  C3D
		  (+ (vl-string-search "." C3D) 1)
		  )
		)
	  C3D (vla-getinterfaceobject
		(vlax-get-acad-object)
		(strcat "AeccXUiLand.AeccApplication." C3D)
		)
	  )
    (setq C3Ddoc (vla-get-activedocument C3D))
    )

  

(defun comp (opr1 item1 opr2 item2)
  (if (equal (item2 a) (item2 b) 0.1)
    (opr1 (item1 a) (item1 b))
    (opr2 (item2 a) (item2 b))
    )
  )
  
  (getC3D)
  (setq points (vlax-get C3Ddoc 'points))
  (setq eName1 nil)
  (while (= eName1 nil)
    (initget 1)
    (setq eName1 (car (entsel "\nSelect AECC_COGO_POINT rawdescription: ")))
    (if (= (cdr (assoc 0 (entget eName1))) "AECC_COGO_POINT")
      (setq rawData (vlax-get (vlax-ename->vla-object eName1) 'rawdescription))
      (setq eName1 nil)
      )
    )
  
  (if rawData
    (progn
      
      (setq points (vlax-get C3Ddoc 'points))
      (setq pntnums nil)
      (vlax-for pntobj points
	(if (= (vlax-get pntobj 'rawdescription) rawData)
	  (setq pntnums (cons (list (vlax-get pntobj 'easting) (vlax-get pntobj 'northing)) pntnums))
	  )
	)
      
      ;sort list
      (setq pntnums
	     (mapcar
	       '(lambda (%) (nth % pntnums))
	       (vl-sort-i
		 pntnums
		 '(lambda (a b) (comp > caDr < car))
		 )
	       )
	    )
      
      ;;;  (PRINC xy)
      (entmake
	(list
	  '(0 . "POLYLINE")
	  '(100 . "AcDbEntity")
	  '(100 . "AcDb3dPolyline")
	  '(66 . 1)
	  '(62 . 1)
	  '(10 0.0 0.0 0.0)
	  '(70 . 8)
	  '(210 0.0 0.0 1.0)
	  )
	)
      
      (foreach pt pntnums
	(entmake
	  (list
	    '(0 . "VERTEX")
	    '(100 . "AcDbEntity")
	    '(100 . "AcDbVertex")
	    '(100 . "AcDb3dPolylineVertex")
	    (cons 10 pt)
	    '(70 . 32)
	    )
	  )
	)
      
      (entmake
	(list
	  '(0 . "SEQEND")
	  '(100 . "AcDbEntity")
	  )
	)
      
      
      
      
      
      )
    
    
    
    (prompt "\n** Nothing selected ** "))
  (princ)
  )

 

 

 

 

 

 

 

cc.JPG

  • Thanks 1
Link to comment
Share on other sites

 

 

 

@hosneyalaa Thank you so much. The script works like a charm and very intuitive. Though after creating the lines, I checked in the object viewer and the new lines have 0 elevation. Is it possible for the line to inherit the Cogo point's elevation that it connects to? Currently, the lines are flat and don't have height information from the Cogo points. 

 

Have a good day and I greatly appreciate your help. You're very talented.

Link to comment
Share on other sites

try

(defun c:testjionRawData  (/ % C3D C3DDOC ENAME1 PNTNUMS POINTS RAWDATA)
  (vl-load-com)

  
  (defun getC3D ()
    (vl-load-com)
    (setq C3D (strcat "HKEY_LOCAL_MACHINE\\"
		      (if vlax-user-product-key
			(vlax-user-product-key)
			(vlax-product-key)
			)
		      )
	  C3D (vl-registry-read C3D "Release")
	  C3D (substr
		C3D
		1
		(vl-string-search
		  "."
		  C3D
		  (+ (vl-string-search "." C3D) 1)
		  )
		)
	  C3D (vla-getinterfaceobject
		(vlax-get-acad-object)
		(strcat "AeccXUiLand.AeccApplication." C3D)
		)
	  )
    (setq C3Ddoc (vla-get-activedocument C3D))
    )

  

(defun comp (opr1 item1 opr2 item2)
  (if (equal (item2 a) (item2 b) 0.1)
    (opr1 (item1 a) (item1 b))
    (opr2 (item2 a) (item2 b))
    )
  )
  
  (getC3D)
  (setq points (vlax-get C3Ddoc 'points))
  (setq eName1 nil)
  (while (= eName1 nil)
    (initget 1)
    (setq eName1 (car (entsel "\nSelect AECC_COGO_POINT rawdescription: ")))
    (if (= (cdr (assoc 0 (entget eName1))) "AECC_COGO_POINT")
      (setq rawData (vlax-get (vlax-ename->vla-object eName1) 'rawdescription))
      (setq eName1 nil)
      )
    )
  
  (if rawData
    (progn
      
      (setq points (vlax-get C3Ddoc 'points))
      (setq pntnums nil)
      (vlax-for pntobj points
	(if (= (vlax-get pntobj 'rawdescription) rawData)
	  (setq pntnums (cons (list (vlax-get pntobj 'easting) (vlax-get pntobj 'northing)(vlax-get pntobj 'elevation)) pntnums))
	  )
	)
      
      ;sort list
      (setq pntnums
	     (mapcar
	       '(lambda (%) (nth % pntnums))
	       (vl-sort-i
		 pntnums
		 '(lambda (a b) (comp > caDr < car))
		 )
	       )
	    )
      
      ;;;  (PRINC xy)
      (entmake
	(list
	  '(0 . "POLYLINE")
	  '(100 . "AcDbEntity")
	  '(100 . "AcDb3dPolyline")
	  '(66 . 1)
	  '(62 . 1)
	  '(10 0.0 0.0 0.0)
	  '(70 . 8)
	  '(210 0.0 0.0 1.0)
	  )
	)
      
      (foreach pt pntnums
	(entmake
	  (list
	    '(0 . "VERTEX")
	    '(100 . "AcDbEntity")
	    '(100 . "AcDbVertex")
	    '(100 . "AcDb3dPolylineVertex")
	    (cons 10 pt)
	    '(70 . 32)
	    )
	  )
	)
      
      (entmake
	(list
	  '(0 . "SEQEND")
	  '(100 . "AcDbEntity")
	  )
	)
      
      
      
      
      
      )
    
    
    
    (prompt "\n** Nothing selected ** "))
  (princ)
  )

 

  • Thanks 1
Link to comment
Share on other sites

 

@hosneyalaa Thank you so much! That is perfect! It's exactly what I'm looking for. I'm very grateful for your help. 

 

Yes, I will post any new question in the Civil 3D section in the future. 

 

Thanks again to everyone for your time and your replies. All the best to all of you. Have a good day. 

Link to comment
Share on other sites

You quoted I have to manually put in each coordinated Cogo point (from old plans) 

 

So why not make a csv file with P,E,N,Z,D if your picking points from a existing plan what do they have, are they on a layer and with z's.

 

By picking you can look at stringing the code using a while pick say edge of bitumen in sequence, so P,E,N,Z,001EB  gets created the other side would be P,E,N,Z,002EB so the 2 sides do not join. 

 

Can you post a old plan dwg. May be able to do something with it.

Edited by BIGAL
  • Like 2
Link to comment
Share on other sites

5 hours ago, BIGAL said:

You quoted I have to manually put in each coordinated Cogo point (from old plans) 

 

So why not make a csv file with P,E,N,Z,D if your picking points from a existing plan what do they have, are they on a layer and with z's.

 

By picking you can look at stringing the code using a while pick say edge of bitumen in sequence, so P,E,N,Z,001EB  gets created the other side would be P,E,N,Z,002EB so the 2 sides do not join. 

 

Can you post a old plan dwg. May be able to do something with it.

 

The old plans are on scanned paper with a long list of coordinates accompanied with diagram sketches. No csv point file. Thanks and have a goo day.

Link to comment
Share on other sites

Our surveyors would go out and resurvey faster than say converting the paper to cad. How many hours are you spending ?

 

Use a spreadsheet or even notepad for entry of X & Y then can do a column that looks like this,

 

-la M EB C 1 EB

 

PLine

X,Y

X,Y

X,Y

 

-la M CL c 2 CL

 

PL

X,Y

X,Y

X,Y

 

    <-- note the blank lines this is the equivalent to press Enter 

Just copy the column to Autocad command line and all your lines will appear, this method has been known about for years.

  • Thanks 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...