Jump to content

Recommended Posts

Posted

Dear Members,

 

I have a ployline with dautm text value and datum line , I want text label of pline start vertex, intersection pont  and end vertex, based on datum.

 

If any have plz share need only y value, elevation, level of pline .

 

Thanks 

 

See attached cad file 

 

Thanks 

POLYLINE Y VALUE.dwg

Posted (edited)

Long time I'm nothing written in Lisp. So, I hoppe it will serve you. Also, you can saw a short video how it works.

 

The code:

(prompt "\nTo run a LISP type: yval")
(princ)

(defun c:yval ( / old_osmode pline spt ept spt_pline ept_pline datum_line yval_datum_line yval_start_pline yval_end_pline txt_position ang_spt_pline ang_ept_pline datum_value intersecting_lines len i int_pt_pline int_pt_datum_line dist yval_position ang)

  (setq old_osmode (getvar 'osmode))
    
  (setq pline (car (entsel "\nSelect Polyline to get an Elevation:")))
  
  (while (or (equal pline nil) (not (equal "LWPOLYLINE" (cdr (assoc 0 (entget pline))))))
    
    (prompt "\nSelected entity must be LWPOLYLINE. Try again...\n")
    (setq pline (car (entsel "\nSelect Polyline to get an Elevation:")))
    
    )
  
  (setq spt_pline (vlax-curve-getStartPoint pline)
	ept_pline (vlax-curve-getEndPoint pline)
	)
  
  (if (> (car spt_pline) (car ept_pline))
    
    (progn
      
      (command-s "_reverse" pline "")
      
      (setq spt_pline (vlax-curve-getStartPoint pline)
	    ept_pline (vlax-curve-getEndPoint pline)
	    )
      )
    
    )
  
  (setq datum_line (car (entsel "\nSelect Datum Line:")))
  
  (while (or (equal datum_line nil) (not (equal "LINE" (cdr (assoc 0 (entget datum_line))))))
    
    (prompt "\nSelected entity must be LINE. Try again...\n")
    (setq datum_line (car (entsel "\nSelect Datum Line:\n")))
    
    )
  
  (setq yval_datum_line (cadr (vlax-curve-getStartPoint datum_line))
	yval_start_pline (- (cadr spt_pline) yval_datum_line)
	yval_end_pline (- (cadr ept_pline) yval_datum_line)
	)
  
  (setq txt_position (getpoint "\nPick the lower-left corner of the box for elevation value:\n"))

  (setvar 'osmode 0)
   
  (setq datum_value (car (entsel "\nSelect Datum value:")))
  
  (if (equal "MTEXT" (cdr (assoc 0 (entget datum_value))))
    
    (setq datum_value (LM:UnFormat (cdr (assoc 1 (entget datum_value))) T))
    
    (setq datum_value (cdr (assoc 1 (entget datum_value))))
    
    )

  (setq ang_spt_pline (angle (setq yval_position_one (list (car spt_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))) spt_pline)
	ang_ept_pline (angle (setq yval_position_two (list (car ept_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))) ept_pline)
	)
  
  (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ yval_start_pline (atof datum_value)) 2 3)) (cons 10 yval_position_one) (cons 11 yval_position_one) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_spt_pline)))
  (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ yval_end_pline (atof datum_value)) 2 3)) (cons 10 yval_position_two) (cons 11 yval_position_two) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_ept_pline)))

  (princ "\nSelect intersecting lines:")
  
  (setq intersecting_lines (ssget (list (cons 0 "LINE") (cons 8 "DATUM-GRID")))
	len (sslength intersecting_lines)
	i 0
	)
  
  (while (< i len)
    
    (setq int_pt_pline (vlax-safearray->list (vlax-variant-value (vla-IntersectWith (vlax-ename->vla-object pline) (vlax-ename->vla-object (ssname intersecting_lines i)) acExtendNone)))
	  int_pt_datum_line (vlax-safearray->list (vlax-variant-value (vla-IntersectWith (vlax-ename->vla-object datum_line) (vlax-ename->vla-object (ssname intersecting_lines i)) acExtendNone)))
	  dist (distance int_pt_pline int_pt_datum_line)
	  yval_position (list (car int_pt_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))
	  ang (angle yval_position int_pt_pline)
	  i (1+ i)
	  )
    
    (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ dist (atof datum_value)) 2 3)) (cons 10 yval_position) (cons 11 yval_position) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_spt_pline)))
    
    )

  (setvar 'osmode old_osmode)

  (prompt "\nAn elevation values were added!")
  (princ)
  
  )


;;-------------------=={ UnFormat String }==------------------;;
;;                                                            ;;
;;  Returns a string with all MText formatting codes removed. ;;
;;------------------------------------------------------------;;
;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  str - String to Process                                   ;;
;;  mtx - MText Flag (T if string is for use in MText)        ;;
;;------------------------------------------------------------;;
;;  Returns:  String with formatting codes removed            ;;
;;------------------------------------------------------------;;

(defun LM:UnFormat ( str mtx / _replace rx )

  (vl-load-com)
  
    (defun _replace ( new old str )
        (vlax-put-property rx 'pattern old)
        (vlax-invoke rx 'replace str new)
    )
    (if (setq rx (vlax-get-or-create-object "VBScript.RegExp"))
        (progn
            (setq str
                (vl-catch-all-apply
                    (function
                        (lambda ( )
                            (vlax-put-property rx 'global     actrue)
                            (vlax-put-property rx 'multiline  actrue)
                            (vlax-put-property rx 'ignorecase acfalse) 
                            (foreach pair
                               '(
                                    ("\032"    . "\\\\\\\\")
                                    (" "       . "\\\\P|\\n|\\t")
                                    ("$1"      . "\\\\(\\\\[ACcFfHLlOopQTW])|\\\\[ACcFfHLlOopQTW][^\\\\;]*;|\\\\[ACcFfHLlOopQTW]")
                                    ("$1$2/$3" . "([^\\\\])\\\\S([^;]*)[/#\\^]([^;]*);")
                                    ("$1$2"    . "\\\\(\\\\S)|[\\\\](})|}")
                                    ("$1"      . "[\\\\]({)|{")
                                )
                                (setq str (_replace (car pair) (cdr pair) str))
                            )
                            (if mtx
                                (_replace "\\\\" "\032" (_replace "\\$1$2$3" "(\\\\[ACcFfHLlOoPpQSTW])|({)|(})" str))
                                (_replace "\\"   "\032" str)
                            )
                        )
                    )
                )
            )
            (vlax-release-object rx)
            (if (null (vl-catch-all-error-p str))
                str
            )
        )
    )
)

 

The short video:

Best regards.

Edited by Saxlle
Added "datum value" into the counting.
  • Like 4
Posted

This takes into account a datum and scale, metric only. You need dummy text as it updates the text. Note this was written in 2014.

 

SurfaceRL.lsp

 

 

Posted
13 hours ago, Saxlle said:

Long time I'm nothing written in Lisp. So, I hoppe it will serve you. Also, you can saw a short video how it works.

 

The code:

(prompt "\nTo run a LISP type: yval")
(princ)

(defun c:yval ( / old_osmode pline spt ept spt_pline ept_pline datum_line yval_datum_line yval_start_pline yval_end_pline txt_position ang_spt_pline ang_ept_pline datum_value intersecting_lines len i int_pt_pline int_pt_datum_line dist yval_position ang)

  (setq old_osmode (getvar 'osmode))
    
  (setq pline (car (entsel "\nSelect Polyline to get an Elevation:")))
  
  (while (or (equal pline nil) (not (equal "LWPOLYLINE" (cdr (assoc 0 (entget pline))))))
    
    (prompt "\nSelected entity must be LWPOLYLINE. Try again...\n")
    (setq pline (car (entsel "\nSelect Polyline to get an Elevation:")))
    
    )
  
  (setq spt_pline (vlax-curve-getStartPoint pline)
	ept_pline (vlax-curve-getEndPoint pline)
	)
  
  (if (> (car spt_pline) (car ept_pline))
    
    (progn
      
      (command-s "_reverse" pline "")
      
      (setq spt_pline (vlax-curve-getStartPoint pline)
	    ept_pline (vlax-curve-getEndPoint pline)
	    )
      )
    
    )
  
  (setq datum_line (car (entsel "\nSelect Datum Line:")))
  
  (while (or (equal datum_line nil) (not (equal "LINE" (cdr (assoc 0 (entget datum_line))))))
    
    (prompt "\nSelected entity must be LINE. Try again...\n")
    (setq datum_line (car (entsel "\nSelect Datum Line:\n")))
    
    )
  
  (setq yval_datum_line (cadr (vlax-curve-getStartPoint datum_line))
	yval_start_pline (- (cadr spt_pline) yval_datum_line)
	yval_end_pline (- (cadr ept_pline) yval_datum_line)
	)
  
  (setq txt_position (getpoint "\nPick the lower-left corner of the box for elevation value:\n"))

  (setvar 'osmode 0)
   
  (setq datum_value (car (entsel "\nSelect Datum value:")))
  
  (if (equal "MTEXT" (cdr (assoc 0 (entget datum_value))))
    
    (setq datum_value (LM:UnFormat (cdr (assoc 1 (entget datum_value))) T))
    
    (setq datum_value (cdr (assoc 1 (entget datum_value))))
    
    )

  (setq ang_spt_pline (angle (setq yval_position_one (list (car spt_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))) spt_pline)
	ang_ept_pline (angle (setq yval_position_two (list (car ept_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))) ept_pline)
	)
  
  (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ yval_start_pline (atof datum_value)) 2 3)) (cons 10 yval_position_one) (cons 11 yval_position_one) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_spt_pline)))
  (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ yval_end_pline (atof datum_value)) 2 3)) (cons 10 yval_position_two) (cons 11 yval_position_two) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_ept_pline)))

  (princ "\nSelect intersecting lines:")
  
  (setq intersecting_lines (ssget (list (cons 0 "LINE") (cons 8 "DATUM-GRID")))
	len (sslength intersecting_lines)
	i 0
	)
  
  (while (< i len)
    
    (setq int_pt_pline (vlax-safearray->list (vlax-variant-value (vla-IntersectWith (vlax-ename->vla-object pline) (vlax-ename->vla-object (ssname intersecting_lines i)) acExtendNone)))
	  int_pt_datum_line (vlax-safearray->list (vlax-variant-value (vla-IntersectWith (vlax-ename->vla-object datum_line) (vlax-ename->vla-object (ssname intersecting_lines i)) acExtendNone)))
	  dist (distance int_pt_pline int_pt_datum_line)
	  yval_position (list (car int_pt_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))
	  ang (angle yval_position int_pt_pline)
	  i (1+ i)
	  )
    
    (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos dist 2 3)) (cons 10 yval_position) (cons 11 yval_position) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_spt_pline)))
    
    )

  (setvar 'osmode old_osmode)

  (prompt "\nAn elevation values were added!")
  (princ)
  
  )


;;-------------------=={ UnFormat String }==------------------;;
;;                                                            ;;
;;  Returns a string with all MText formatting codes removed. ;;
;;------------------------------------------------------------;;
;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  str - String to Process                                   ;;
;;  mtx - MText Flag (T if string is for use in MText)        ;;
;;------------------------------------------------------------;;
;;  Returns:  String with formatting codes removed            ;;
;;------------------------------------------------------------;;

(defun LM:UnFormat ( str mtx / _replace rx )

  (vl-load-com)
  
    (defun _replace ( new old str )
        (vlax-put-property rx 'pattern old)
        (vlax-invoke rx 'replace str new)
    )
    (if (setq rx (vlax-get-or-create-object "VBScript.RegExp"))
        (progn
            (setq str
                (vl-catch-all-apply
                    (function
                        (lambda ( )
                            (vlax-put-property rx 'global     actrue)
                            (vlax-put-property rx 'multiline  actrue)
                            (vlax-put-property rx 'ignorecase acfalse) 
                            (foreach pair
                               '(
                                    ("\032"    . "\\\\\\\\")
                                    (" "       . "\\\\P|\\n|\\t")
                                    ("$1"      . "\\\\(\\\\[ACcFfHLlOopQTW])|\\\\[ACcFfHLlOopQTW][^\\\\;]*;|\\\\[ACcFfHLlOopQTW]")
                                    ("$1$2/$3" . "([^\\\\])\\\\S([^;]*)[/#\\^]([^;]*);")
                                    ("$1$2"    . "\\\\(\\\\S)|[\\\\](})|}")
                                    ("$1"      . "[\\\\]({)|{")
                                )
                                (setq str (_replace (car pair) (cdr pair) str))
                            )
                            (if mtx
                                (_replace "\\\\" "\032" (_replace "\\$1$2$3" "(\\\\[ACcFfHLlOoPpQSTW])|({)|(})" str))
                                (_replace "\\"   "\032" str)
                            )
                        )
                    )
                )
            )
            (vlax-release-object rx)
            (if (null (vl-catch-all-error-p str))
                str
            )
        )
    )
)

 

The short video:

 

Best regards.

Thanks for your help sir,  one issue I notice, if I change the datum value and keep datum line same ,value of intersection point not coming accurate, only start vertex and and vertex is accurate. Note Same section but change datum value.

Posted

@Ish, if you don't mind, can you please attach video, gif, picture, etc. of the problem which you issued, because I'm not sure to fully understand the problem. Thanks

  • Agree 1
Posted
2 hours ago, Saxlle said:

@Ish, if you don't mind, can you please attach video, gif, picture, etc. of the problem which you issued, because I'm not sure to fully understand the problem. Thanks

Sir, just I change date value 0 to 1, because dautm value and line is always varies.

Program working perfectly for zero 0 datum value and line, if dautm value and line change, not getting accurate level , this attachment. Thanks 

DAUM +01.jpg

DATUM VALUE CHANGE.dwg

Posted

@Ish, I modified the code from the fist post, just copy it again and try it.

 

Now, you will get the desired elevation values (picture 1, the red rectangle).

 

image.thumb.png.0b29033f35874d7f7c29235fc61ee56f.png

 

Best regards.

 

Posted
On 10/17/2025 at 5:12 PM, Saxlle said:

Long time I'm nothing written in Lisp. So, I hoppe it will serve you. Also, you can saw a short video how it works.

 

The code:

(prompt "\nTo run a LISP type: yval")
(princ)

(defun c:yval ( / old_osmode pline spt ept spt_pline ept_pline datum_line yval_datum_line yval_start_pline yval_end_pline txt_position ang_spt_pline ang_ept_pline datum_value intersecting_lines len i int_pt_pline int_pt_datum_line dist yval_position ang)

  (setq old_osmode (getvar 'osmode))
    
  (setq pline (car (entsel "\nSelect Polyline to get an Elevation:")))
  
  (while (or (equal pline nil) (not (equal "LWPOLYLINE" (cdr (assoc 0 (entget pline))))))
    
    (prompt "\nSelected entity must be LWPOLYLINE. Try again...\n")
    (setq pline (car (entsel "\nSelect Polyline to get an Elevation:")))
    
    )
  
  (setq spt_pline (vlax-curve-getStartPoint pline)
	ept_pline (vlax-curve-getEndPoint pline)
	)
  
  (if (> (car spt_pline) (car ept_pline))
    
    (progn
      
      (command-s "_reverse" pline "")
      
      (setq spt_pline (vlax-curve-getStartPoint pline)
	    ept_pline (vlax-curve-getEndPoint pline)
	    )
      )
    
    )
  
  (setq datum_line (car (entsel "\nSelect Datum Line:")))
  
  (while (or (equal datum_line nil) (not (equal "LINE" (cdr (assoc 0 (entget datum_line))))))
    
    (prompt "\nSelected entity must be LINE. Try again...\n")
    (setq datum_line (car (entsel "\nSelect Datum Line:\n")))
    
    )
  
  (setq yval_datum_line (cadr (vlax-curve-getStartPoint datum_line))
	yval_start_pline (- (cadr spt_pline) yval_datum_line)
	yval_end_pline (- (cadr ept_pline) yval_datum_line)
	)
  
  (setq txt_position (getpoint "\nPick the lower-left corner of the box for elevation value:\n"))

  (setvar 'osmode 0)
   
  (setq datum_value (car (entsel "\nSelect Datum value:")))
  
  (if (equal "MTEXT" (cdr (assoc 0 (entget datum_value))))
    
    (setq datum_value (LM:UnFormat (cdr (assoc 1 (entget datum_value))) T))
    
    (setq datum_value (cdr (assoc 1 (entget datum_value))))
    
    )

  (setq ang_spt_pline (angle (setq yval_position_one (list (car spt_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))) spt_pline)
	ang_ept_pline (angle (setq yval_position_two (list (car ept_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))) ept_pline)
	)
  
  (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ yval_start_pline (atof datum_value)) 2 3)) (cons 10 yval_position_one) (cons 11 yval_position_one) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_spt_pline)))
  (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ yval_end_pline (atof datum_value)) 2 3)) (cons 10 yval_position_two) (cons 11 yval_position_two) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_ept_pline)))

  (princ "\nSelect intersecting lines:")
  
  (setq intersecting_lines (ssget (list (cons 0 "LINE") (cons 8 "DATUM-GRID")))
	len (sslength intersecting_lines)
	i 0
	)
  
  (while (< i len)
    
    (setq int_pt_pline (vlax-safearray->list (vlax-variant-value (vla-IntersectWith (vlax-ename->vla-object pline) (vlax-ename->vla-object (ssname intersecting_lines i)) acExtendNone)))
	  int_pt_datum_line (vlax-safearray->list (vlax-variant-value (vla-IntersectWith (vlax-ename->vla-object datum_line) (vlax-ename->vla-object (ssname intersecting_lines i)) acExtendNone)))
	  dist (distance int_pt_pline int_pt_datum_line)
	  yval_position (list (car int_pt_pline) (+ (cadr txt_position) 0.1) (caddr txt_position))
	  ang (angle yval_position int_pt_pline)
	  i (1+ i)
	  )
    
    (entmake (list (cons 0 "TEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbText") (cons 1 (rtos (+ dist (atof datum_value)) 2 3)) (cons 10 yval_position) (cons 11 yval_position) (cons 40 0.35) (cons 72 0) (cons 73 2) (cons 50 ang_spt_pline)))
    
    )

  (setvar 'osmode old_osmode)

  (prompt "\nAn elevation values were added!")
  (princ)
  
  )


;;-------------------=={ UnFormat String }==------------------;;
;;                                                            ;;
;;  Returns a string with all MText formatting codes removed. ;;
;;------------------------------------------------------------;;
;;  Author: Lee Mac, Copyright © 2011 - www.lee-mac.com       ;;
;;------------------------------------------------------------;;
;;  Arguments:                                                ;;
;;  str - String to Process                                   ;;
;;  mtx - MText Flag (T if string is for use in MText)        ;;
;;------------------------------------------------------------;;
;;  Returns:  String with formatting codes removed            ;;
;;------------------------------------------------------------;;

(defun LM:UnFormat ( str mtx / _replace rx )

  (vl-load-com)
  
    (defun _replace ( new old str )
        (vlax-put-property rx 'pattern old)
        (vlax-invoke rx 'replace str new)
    )
    (if (setq rx (vlax-get-or-create-object "VBScript.RegExp"))
        (progn
            (setq str
                (vl-catch-all-apply
                    (function
                        (lambda ( )
                            (vlax-put-property rx 'global     actrue)
                            (vlax-put-property rx 'multiline  actrue)
                            (vlax-put-property rx 'ignorecase acfalse) 
                            (foreach pair
                               '(
                                    ("\032"    . "\\\\\\\\")
                                    (" "       . "\\\\P|\\n|\\t")
                                    ("$1"      . "\\\\(\\\\[ACcFfHLlOopQTW])|\\\\[ACcFfHLlOopQTW][^\\\\;]*;|\\\\[ACcFfHLlOopQTW]")
                                    ("$1$2/$3" . "([^\\\\])\\\\S([^;]*)[/#\\^]([^;]*);")
                                    ("$1$2"    . "\\\\(\\\\S)|[\\\\](})|}")
                                    ("$1"      . "[\\\\]({)|{")
                                )
                                (setq str (_replace (car pair) (cdr pair) str))
                            )
                            (if mtx
                                (_replace "\\\\" "\032" (_replace "\\$1$2$3" "(\\\\[ACcFfHLlOoPpQSTW])|({)|(})" str))
                                (_replace "\\"   "\032" str)
                            )
                        )
                    )
                )
            )
            (vlax-release-object rx)
            (if (null (vl-catch-all-error-p str))
                str
            )
        )
    )
)

 

The short video:

 

Best regards.

hi This is a very good lisp, can this be still upgraded to show the station of the selected lines also, at a certain distance south. like 20 or something.

Posted

Hi @symoin

 

If you can provide the an example file with explanations inside of what you want, I can try it to modified the code for your purposes.

 

Best regards.

Posted
9 hours ago, Saxlle said:

Hi @symoin

 

If you can provide the an example file with explanations inside of what you want, I can try it to modified the code for your purposes.

 

Best regards.

image.png.55f7b85300035795f5fa376ec6bb0616.png

 

Here, I have the profile generated from Civil 3D. The elevations and stations are generated at every 25m interval (white lines), but the crossings are not included. So if I get a lisp that will generate the staion and elevations for the crossings (pink lines) same as the details for the white lines. with your Yval we can get the elevations but need the stations also.

Posted

Trying to add the purple line values will introduce a new problem of overlapping text. trying to remember with CIV3D add extra pts in a long section in particular, one way is add that chainage as part of the alignment.

 

Using say Civil Site Design it has this add extra chainages feature built in. Runs in Civ3D. You can do a mini range start-end chainge, spacing and so on.

Posted
14 hours ago, symoin said:

Here, I have the profile generated from Civil 3D

Can you provide the an example drawing? I'm not familiar with working in Civil 3D.

  • SLW210 changed the title to Lisp for to get y value of polyline based on datum value and line.
Posted
12 hours ago, Saxlle said:

Can you provide the an example drawing? I'm not familiar with working in Civil 3D.

Here is the profile sample

PROFILE-SAMPLE.dwg

Posted

@symoin

 

Can you please explain the logic of getting an elevation from "Profile-sample.dwg"? It is kind different from the picture which were you posted above. If I am not getting wrong, from picture below, the elevation need to looks like this (so, the equidistant need to be equal?):

 

image.png.52522dd6a6ef002230b12cd9e3bafc9a.png

 

Best regards.

Posted

If your trying to get the levels shown by the Brown lines color 11 you will end up with a mess of overlapping text. In this image looks like a road etc so want levels.

image.png.437e6242b4107f5ed21db04c70a74c69.png

 

Civ3D at times lacks some functionality, it looks like you have used a built in grid option for plotting long section etc. You may be better off going back to your CAD dealer and ask for help about how to set up CIV3D to meet your needs. I know in other add on software can use different methods  to set what points get levels plotted, A lot of times the complexity of using CIV3D is a problem and finding the solution is difficult.

 

Maybe post this question into the CIV3D forum. I stopped using CIV3D many years ago so can not help.

Posted
8 hours ago, BIGAL said:

If your trying to get the levels shown by the Brown lines color 11 you will end up with a mess of overlapping text. In this image looks like a road etc so want levels.

 

Definitely, there will be bunch of overlapping texts. But, I think the problem is in the "grid", the equidistants are not equal and elevations can't be obtained.

 

As I mentioned: I'm not familiar with working in Civil 3D, so I can't help here further.

Posted

For my long sections I tend to create a block for the long section itself and then scale the X and Y axis to whatever scales I want ( I tend to use a Y scale of 5x, and X at 1x ) - that makes the analysis easier

 

This is what I use.

Select the surface profile

Select the route / Datum line (I use this to measure the designed buried depths for new services)

Loop to select the distance marker / indicator and then its associated text to update

 

 

 

If I was doing this I would copy your vertical lines and associated texts to the points you want. Extend or trim these lines to the surface polyline then run this LISP to complete the texts. Can be a bit long to do a really long long section but I don't do so many of these to make the coding worth selecting everything all at once... so for now select all one at a time

 

 

 

(defun c:LSBuriedDepth ( / )
  (defun LM:intersections ( ob1 ob2 mod / lst rtn ) ; Lee Mac
    (if (and (vlax-method-applicable-p ob1 'intersectwith)
             (vlax-method-applicable-p ob2 'intersectwith)
             (setq lst (vlax-invoke ob1 'intersectwith ob2 mod))
        ) ; end and
        (repeat (/ (length lst) 3)
            (setq rtn (cons (list (car lst) (cadr lst) (caddr lst)) rtn)
                  lst (cdddr lst)
            ) ; end setq
        ) ; end repeat
    ) ; end if
    (reverse rtn)
  ) ; end defun
  (defun inter ( Ent1 Ent2 / obj1 obj2 ) ;Lee Mac
    (setq obj1 Ent1)
    (setq obj2 Ent2)
      (foreach pnt (LM:intersections (vlax-ename->vla-object obj1) (vlax-ename->vla-object obj2) acextendOTHERENTITY)
        (setq pt pnt)
      ) ; end foreach
    pt
  ) ; end defun
  (defun LStext ( n / EndLst ent entlst) ;updates text to 'n'
    (setq EndLst "No")
    (while (= EndLst "No") ;;loop till enter or space
      (progn
        (setvar 'errno 0)
        (setq ent (car (nentsel (strcat "\nSelect text to change"))))
        (cond
          ( (= 7 (getvar 'errno)) ;a
            (princ "\nMissed, try again.")
          ) ;end cond a
          ( (and (/= (cdr (assoc 0 (entget ent))) "TEXT")(/= (cdr (assoc 0 (entget ent))) "MTEXT") )
            (princ "\nMissed, try again")
          )
          ( ;'t'
            (setq entlst (entget ent))
            (setq entlst (subst (cons 1 n) (assoc 1 entlst) entlst))
            (entmod entlst)
            (entupd ent)
            (setq EndLst "Yes")
          ) ;end cond b
        ) ;end Cond
      ) ;end progn
    ) ;end while
    (princ)
  ) ; end defun

;;End subfunctions

  (setq Ent1 (car (nentsel "\nSelect Surface Line (explode Blocks)")))
  (setq Ent2 (car (nentsel "\nSelect Route or Datum Line (explode Blocks)")))

  (while  (setq Ent3 (car (entsel "\nSelect Distance Marker")))
;;    (setq Int1 (inter Ent1 Ent3))
;;    (setq Int2 (inter Ent2 Ent3))
    (setq MyDist (- (cadr (inter Ent1 Ent3)) (cadr (inter Ent2 Ent3)))) ; Adjust here MyDist to acount for any scaling factors
    (setq MyDist (rtos MyDist 2 3))
    (LStext (vl-princ-to-string MyDist))
  ) ; end while
)

 

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...