Community
Civil 3D Forum
Welcome to Autodesk’s Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding .NET info to a Title Block?

2 REPLIES 2
Reply
Message 1 of 3
everblader
230 Views, 2 Replies

Adding .NET info to a Title Block?

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
2 REPLIES 2
Message 2 of 3
Jeff_M
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
EESignature
Message 3 of 3
everblader
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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


Autodesk Design & Make Report