AutoCAD Civil 3D
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Creating Bearing/Di stance table using Points
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I am using Civil 3D 2012. I know how to label a line with bearing and distance. What I would like to do is make a table with these bearings and distances referencing the point numbers. For instance, I have a new ROW line that starts at point 1000 and changes direction at point 1001 and changes direction at 1002 and so on. I need a table that shows Points 1000-1001 is ___ Bearing and ___ Distance.
The lines are not parcel lines; they are only line segments.
Thanks.
Re: Creating Bearing/Di stance table using Points
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I think it was the 2013 release that added the ability to label by X,Y point (not COGO point) but that won't help even if you were on 2013.
You'd have to look into writing a .NET function to do it. Might not update dynamically with the point locations, but could give you some static results that will print what you want.
Regards,
Mike
Re: Creating Bearing/Di stance table using Points
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
I have found a code (below) but I would like to modify it to allow me to choose my own point numbers and have it in feet instead of meters.
Can anyone help me with this?
(vl-load-com)
(defun C:Bearings (/ *error* acsp ang atable cnt col dist item osm
point_list pt row table_data tmp tmp_data
degreeloc minuteloc secondloc AngString)
(defun *error* (msg)
(if (and msg
(not
(member msg
'("console break" "Function cancelled" "quit / exit abort"))))
(princ (strcat "\nError: " msg))
)
(if osm
(setvar "osmode" osm))
(princ)
)
(setq osm (getvar "osmode"))
(setvar "osmode" 1)
(setq cnt 1)
(while (setq pt (getpoint
(strcat "\n >> Specify point #"
(itoa cnt)
" by order (hit Enter to exit) >> ")))
(setq point_list (cons pt point_list)
cnt (1+ cnt))
)
(setq point_list (reverse point_list))
(setq cnt 0)
(while (<= cnt (- (length point_list) 2))
(setq tmp (list (strcat (itoa (1+ cnt)) " - " (itoa (+ cnt 2)))
(nth cnt point_list)
(nth (1+ cnt) point_list))
tmp_data (cons tmp tmp_data)
)
(setq cnt (1+ cnt))
)
(setq tmp (list (strcat (itoa (length point_list)) " - 1")
(last point_list)
(car point_list))
tmp_data (cons tmp tmp_data)
)
(setq tmp_data (reverse tmp_data))
(foreach item tmp_data
(setq ang (angtos(angle (cadr item) (caddr item))4 4)
degreeloc (vl-string-position (ascii "d") ang);location of "d"
minuteloc (vl-string-position (ascii "'") ang);location of '
secondloc (vl-string-position (ascii "\"") ang);location of "
);setq
(if (= (- minuteloc degreeloc) 2)
(setq ang (vl-string-subst "d0" "d" ang));add 0 for seconds under 10
);if
(if (= (- secondloc minuteloc) 2)
(setq ang (vl-string-subst "'0" "'" ang));add 0 for minutes under 10
);if
(setq AngString (vl-string-subst "°" "d" ang);Substitute degree symbol
dist (distance (cadr item) (caddr item))
dist (strcat (rtos dist 2 2) " m.")
tmp (list (car item) AngString dist)
table_data (cons tmp table_data)
);setq
);foreach
(setq
table_data (reverse table_data)
pt (getpoint "\n >> Specify insertion point >> ")
acsp (vla-get-block
(vla-get-activelayout
(vla-get-activedocument
(vlax-get-acad-object))))
atable (vlax-invoke acsp 'AddTable pt
(+ 2 (length table_data))
(length (car table_data))
(* (getvar "textsize") 2.0)
(* (getvar "textsize") 15))
);setq
(vla-put-regeneratetablesuppressed atable :vlax-true)
(vla-settextheight atable actitlerow (getvar "textsize"))
(vla-settextheight atable acheaderrow (getvar "textsize"))
(vla-settextheight atable acdatarow (getvar "textsize"))
(vla-put-vertcellmargin atable (/ (getvar "textsize") 4.25))
(vla-settext atable 0 0 "TECHNICAL DESCRIPTIONS")
(vla-settext atable 1 0 "LINES")
(vla-settext atable 1 1 "BEARINGS")
(vla-settext atable 1 2 "DISTANCES")
(setq row 2)
(foreach item table_data
(setq col 0)
(foreach x item
(vla-settext atable row col x)
(vla-setcellalignment atable row col acMiddleCenter)
(setq col (1+ col)))
(setq row (1+ row))
)
(vla-put-regeneratetablesuppressed atable :vlax-false)
(*error* nil)
(princ)
)
Re: Creating Bearing/Di stance table using Points
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Try asking over here
Win 7 Pro, 32 bit; Intel Core i5 @ 2.80GHz; 4GB RAM—Civil 3D 2008 & 2011
__________________________________________________________
Credit where credit is due! Give kudos or accept as solution whenever you can.
