AutoCAD Civil 3D General Discussion

AutoCAD Civil 3D General Discussion

Reply
Contributor
everblader
Posts: 12
Registered: ‎11-13-2006
Message 1 of 3 (142 Views)

Adding .NET info to a Title Block?

142 Views, 2 Replies
07-12-2012 06:13 AM

Is there a way to display the projection (FL-W83) or Datum (NAD83) of a DWG file in the titleblock? Maybe using fields, or a diesel expression of some sort? I belive the information resides in the .NET framework, how can I get that into my titleblock?

HP Z400 Workstation
Intel Xeon W3550 -Cores 4
12GB Triple-Channel DDR3 @ 533MHz
2-HP LE2201w @ 1680x1050
ATI FirePro V3800 (FireGL) (HP)
MS Windows 7 64-bit
*Expert Elite*
Jeff_M
Posts: 4,481
Registered: ‎07-22-2003
Message 2 of 3 (137 Views)

Re: Adding .NET info to a Title Block?

07-12-2012 06:42 AM in reply to: everblader

You don't need .NET to get this (although you could if you want), it is accessible using the COM API meaning you can use some simple lisp to get the info. Then you could populate the attributes in the titleblock with the desired info: If you need help with the editing the titleblock, there are plenty of posts in the AutoCAD customization -> lisp forum.

(vl-load-com)
(setq prod (vlax-product-key))
(setq prodStr (strcat "AeccXUiLand.AeccApplication"
		      (cond ((vl-string-search "\\R17.0\\" prod)
			     ".4.0"
			    )
			    ;;2007
			    ((vl-string-search "\\R17.1\\" prod)
			     ".5.0"
			    )
			    ;;2008
			    ((vl-string-search "\\R17.2\\" prod)
			     ".6.0"
			    )
			    ;;2009
			    ((vl-string-search "\\R18.0\\" prod)
			     ".7.0"
			    )
			    ;;2010
			    ((vl-string-search "\\R18.1\\" prod)
			     ".8.0"
			    )
			    ;;2011
			    ((vl-string-search "\\R18.2\\" prod)
			     ".9.0"
			    )
			    ;;2012
			    ((vl-string-search "\\R19.0\\" prod)
			     ".10.0"
			    )
			    ;;2013
			    (t "")
		      )
	      )
)
(setq *acad* (vlax-get-acad-object))
(setq C3D (vla-getinterfaceobject *acad* prodStr))
(setq C3Ddoc (vla-get-activedocument C3D)
      settings (vlax-get c3ddoc 'settings)
      dwgstg   (vlax-get settings 'drawingsettings)
      zonestg  (vlax-get dwgstg 'unitzonesettings)
      coordsys (vlax-get zonestg 'coordinatesystem)
)

 from that final variable you can get the properties you need:

(vlax-get coordsys 'cscode)
(vlax-get coordsys 'datum)
(vlax-get coordsys 'description)
(vlax-get coordsys 'projection)
(vlax-get coordsys 'unit)

 You probably just need the first 2.

Jeff_M, also a frequent Swamper
Contributor
everblader
Posts: 12
Registered: ‎11-13-2006
Message 3 of 3 (125 Views)

Re: Adding .NET info to a Title Block?

07-12-2012 08:15 AM in reply to: Jeff_M

Thanks, I'll give it a try.

HP Z400 Workstation
Intel Xeon W3550 -Cores 4
12GB Triple-Channel DDR3 @ 533MHz
2-HP LE2201w @ 1680x1050
ATI FirePro V3800 (FireGL) (HP)
MS Windows 7 64-bit
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!