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

Snoop Civil3D 2012 Database Tool

14 REPLIES 14
SOLVED
Reply
Message 1 of 15
Partha.Sarkar
1149 Views, 14 Replies

Snoop Civil3D 2012 Database Tool

Hi,

 

Did you ever look for a Civil 3D Database Snoop utility ? If yes, the following information might be useful to you. Please note, the source code of this utility is also uploaded to Civil 3D Developer ceneter page.

 

Snoop Civil3D 2012 Database  is now Live in Civil 3D Developer Center Page http://usa.autodesk.com/adsk/servlet/index?siteID=123112&id=8007696

 

This tool allows developers inspect the Civil3D Database without writing code. Everything that is shown is accessible through the API, but this tool does not show everything is accessible on the API. It works by showing the root objects of Civil3D 2012 (i.e. Styles, Alignments, Corridors, Assemblies, Subassemblies, Pipe networks and Surfaces) listing them on the left with all objects on each collections, such as all alignments on the active drawing, and once click on each item, list all its properties on right.

 

To use this tool, start AutoCAD Civil 3D 2012, type NETLOAD at the command line and load the 'SnoopCivil3DObjects.dll'. Run snoopCivil3DDB command. Once the DLL is loaded, you can invoke the command from right mouse click 'Snoop Civil3D'.

 

Tool / Utility download link :  SnoopCivil3DTool 

 

Source code of this Utility :  SnoopCivil3DVSProj


Thanks,



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

14 REPLIES 14
Message 2 of 15
coopdetat
in reply to: Partha.Sarkar

Is there or will there be a version of SnoopCivil3DTool.dll that can be loaded and used in Civil 3D 2013?

---------------------------------------------Signature--------------------------------------------
Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989

Windows 10 Pro 64-bit Intel﴾R﴿ Core﴾TM﴿ i9-12900KF CPU 3.19GHz; 32 GB DDR4 4266 Dual Channel RAM
nVidia Quadro RTX 4000; AutoCAD Civil 3D 2023.2.1 Update
Message 3 of 15
Partha.Sarkar
in reply to: coopdetat

Hi coopdetat,

 

Source code of Snoop Civil3D 2012 Database Tool is available in the following link and one can compile it as well as enhance it to access more Civil 3D objects.

http://download.autodesk.com/media/adn/SnoopCivil3DVSProj.zip

 

I am attaching here the compiled version for Civil 3D 2013 x64 bit for you. Hope this helps.

 

Wishing you all a very Happy and Prosperous New Year !

 

Thanks,

Partha



Partha Sarkar
Developer Technical Services
Autodesk Developer Network

Message 4 of 15
stacy.dunn
in reply to: Partha.Sarkar

Partha,

I tried loading the compiled DLL on a machine that only has 2013 C3D x64 installed.  It is loading from a local drive.

 

I get the following error:

 

Command: netload
Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Temp\SnoopC3DObjects2013x64.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Temp\SnoopC3DObjects2013x64.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()

 

 

 

I noticed that the VB project info still references 2012 dll files.  Could this be the problem?

 

Thank you,

Stacy

Stacy Dunn
Message 5 of 15
Jeff_M
in reply to: stacy.dunn

Did you Unblock the zip file before extracting the DLL, Stacy?

Jeff_M, also a frequent Swamper
EESignature
Message 6 of 15
stacy.dunn
in reply to: Partha.Sarkar

Jeff,

 

I actually do have that option.  We are running an enterprise version of Windows 7, so it may have been disabled by the IT ninjas.  I have not had to do that in the past and have NETloaded many downloaded files without any problem.

 

Am I correct is my guess that the SnoopCivil3D.vbproj file would control the references in the compiled DLL?

 

 <ItemGroup>
    <Reference Include="acdbmgd">
      <HintPath>C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\acdbmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="Acmgd">
      <HintPath>C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\Acmgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AecBaseMgd">
      <HintPath>C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\AecBaseMgd.dll</HintPath>
      <Private>False</Private>
    </Reference>
    <Reference Include="AeccDbMgd">
      <HintPath>C:\Program Files\Autodesk\AutoCAD Civil 3D 2012\AeccDbMgd.dll</HintPath>
      <Private>False</Private>

Stacy Dunn
Message 7 of 15
Jeff_M
in reply to: stacy.dunn

Yes, that's correct, Stacy. However, the link Partha gave is for the 2012 project so it makes sense those are the referenced files. He only posted the compiled for 2013 dll, not the 2013 project Smiley Happy

Jeff_M, also a frequent Swamper
EESignature
Message 8 of 15
Jeff_M
in reply to: stacy.dunn

So you don't see this on the downloaded zip's properties?

1-2-2013 11-26-44 AM.png

 

I didn't know that could be disabled...

Jeff_M, also a frequent Swamper
EESignature
Message 9 of 15
stacy.dunn
in reply to: Partha.Sarkar

Not on the work computer.

 

Capture.PNG

Stacy Dunn
Message 10 of 15
stacy.dunn
in reply to: stacy.dunn

I re-downloaded the zip file and extracted it again.  Now it works.

Stacy Dunn
Message 11 of 15
coopdetat
in reply to: Partha.Sarkar

Hello Partha,


P.S. my intended purpose is to know more of what I can access in the object model using Visual Lisp GET and PUT functions primarily.

 

I downloaded the zip and used WinZIP 14.5 as administrator to unzip the file to C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\  (this is a local physical drive and not a member of a RAID).  It is important to note that I work without a .NET (pun intended) My .NET skill would not catch a butterfly.  I used NETLOAD to attempt to load the dll.  This is the result:

Command: netload
Cannot load assembly. Error details: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\SnoopC3DObjects2013x64.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
File name: 'file:///C:\Program Files\Autodesk\AutoCAD Civil 3D 2013\SnoopC3DObjects2013x64.dll' ---> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
   at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
   at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.LoadFrom(String assemblyFile)
   at Autodesk.AutoCAD.Runtime.ExtensionLoader.Load(String fileName)
   at loadmgd()

---------------------------------------------Signature--------------------------------------------
Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989

Windows 10 Pro 64-bit Intel﴾R﴿ Core﴾TM﴿ i9-12900KF CPU 3.19GHz; 32 GB DDR4 4266 Dual Channel RAM
nVidia Quadro RTX 4000; AutoCAD Civil 3D 2023.2.1 Update
Message 12 of 15
Jeff_M
in reply to: coopdetat

coop,

Did you see my comments to Stacy? Particularly the one about Unblocking the Zip?

Jeff_M, also a frequent Swamper
EESignature
Message 13 of 15
coopdetat
in reply to: Jeff_M

I did and I've never seen anything about unblocking regarding zip files. The concept is completely foreign to me. I use a licensed copy of WinZip 14.5 and in this case I started it with "run as administrator".

---------------------------------------------Signature--------------------------------------------
Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989

Windows 10 Pro 64-bit Intel﴾R﴿ Core﴾TM﴿ i9-12900KF CPU 3.19GHz; 32 GB DDR4 4266 Dual Channel RAM
nVidia Quadro RTX 4000; AutoCAD Civil 3D 2023.2.1 Update
Message 14 of 15
Jeff_M
in reply to: coopdetat

This is a Windows Vista and Win7 security item, flagging potentially harmful files (in this case, ZIP files containing a DLL) when downloaded from the internet. Why Stacy's Enterprise Edition of Win7 doesn't do this, I'm not sure. But it is quite common for this to cause the error you show. Before opening and extracting the dll from the ZIP, right-click the file in Windows Explorer, select Properties, look at the bottom of the General tab. If it has the Unblock button displayed, press it, then select OK. Now you should be able to safely extract the dll and netload it.

Jeff_M, also a frequent Swamper
EESignature
Message 15 of 15
coopdetat
in reply to: coopdetat

I have never seen anything in my Win7x64 OS that is even remotely like the Zip blocking you've shown.  I'm not sure why my system is missing any reference to Zip blocking.  Could it be specific to the application that is assigned to your Zip files for "Opens with" (edit, I see you use winzip as well, so propably not)?  Could it be that blocking is being applied without any reference or link to "Unblock"? Here is what I see in properties for this Zip file (and all other Zip files are very similar):

Zip-props.gifZip-props2.gif

P.S. I use a registry hack that allows me to take ownership of any file... so I can easily get past the "You do not have permission" problem so frequently encountered in Win7.  It adds the "Take Ownership" option to my right-click menu. (http://www.howtogeek.com/howto/windows-vista/add-take-ownership-to-explorer-right-click-menu-in-vist...) It is possible that prior "Take Ownership" events have made the Blocked issue disappear.

On a hunch I unzipped it again and took ownership of the dll... It loaded without incident.

---------------------------------------------Signature--------------------------------------------
Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989

Windows 10 Pro 64-bit Intel﴾R﴿ Core﴾TM﴿ i9-12900KF CPU 3.19GHz; 32 GB DDR4 4266 Dual Channel RAM
nVidia Quadro RTX 4000; AutoCAD Civil 3D 2023.2.1 Update

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

Post to forums  

Rail Community


Autodesk Design & Make Report