BlackBox 发表于 2012-3-27 08:53:51

Civil 3D样式|获取计数失败

最近,我要求一些有关Civil 3D样式的帮助,并感谢Jeff - 我现在有一个DLL可以完成我所追求的事情......用于民用3D 2012...然而,由于某种原因,我的Civil 3D 2011部署不喜欢使用DLL。
这里有一个链接来下载我正在使用的文件:C3D样式工具.zip
而对于其他人来说,DLL在2011年工作正常,所以我试图推断出导致我这一端的问题的原因,但一无所获。任何帮助将不胜感激。
Netload很好,CommandMethod调用很好,并且提示我输入适当的字符串,然后它失败了,引用“获取计数失败”...这是我收到的错误:
See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.
************** Exception Text **************
Autodesk.Civil.CivilException: Get Count Failed
   at Autodesk.Civil.DatabaseServices.Styles.StyleCollectionBase.get_Count()
   at Autodesk.Civil.CollectionEnumerator..ctor(StyleCollectionBase pCollection)
   at Autodesk.Civil.DatabaseServices.Styles.StyleCollectionBase.GetEnumerator()
   at StyleTools.StylesCreatedByUpdate.ListCollection(Type objectType, PropertyInfo pf, Object myStylesRoot)
   at StyleTools.StylesCreatedByUpdate.ListRoot(Object root)
   at StyleTools.StylesCreatedByUpdate.createdbycommand()
   at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorker(MethodInfo mi, Object commandObject, Boolean bLispFunction)
   at Autodesk.AutoCAD.Runtime.CommandClass.InvokeWorkerWithExceptionFilter(MethodInfo mi, Object commandObject, Boolean bLispFunction)
   at Autodesk.AutoCAD.Runtime.CommandClass.CommandThunk.Invoke()
************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5448 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
acdbmgd
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.115.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcdbMgd.DLL
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5453 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
msvcm90
    Assembly Version: 9.0.30729.4940
    Win32 Version: 9.00.30729.4940
    CodeBase: file:///C:/WINDOWS/WinSxS/amd64_microsoft.vc90.crt_1fc8b3b9a1e18e3b_9.0.30729.4940_none_08e4299fa83d7e3c/msvcm90.dll
----------------------------------------
System.Xml
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Xml/2.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
PresentationFramework
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.5011 built by: Win7SP1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework/3.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
WindowsBase
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.5011 built by: Win7SP1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/WindowsBase/3.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
PresentationCore
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.5011 built by: Win7SP1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_64/PresentationCore/3.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
AdApplicationFrame
    Assembly Version: 0.0.0.0
    Win32 Version: 3.0.269.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AdApplicationFrame.DLL
----------------------------------------
AdWindows
    Assembly Version: 3.0.270.0
    Win32 Version: 3.0.270.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AdWindows.DLL
----------------------------------------
PresentationFramework.Aero
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.4902 built by: NetFXw7
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework.Aero/3.0.0.0__31bf3856ad364e35/PresentationFramework.Aero.dll
----------------------------------------
acmgd
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.208.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/acmgd.DLL
----------------------------------------
System.Core
    Assembly Version: 3.5.0.0
    Win32 Version: 3.5.30729.5420 built by: Win7SP1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Core/3.5.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Configuration
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5420 (Win7SP1.050727-5400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Configuration/2.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
AcWindows
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.208.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcWindows.DLL
----------------------------------------
AcWindows.resources
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.49.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/en-US/AcWindows.resources.DLL
----------------------------------------
AcCui
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.115.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcCui.DLL
----------------------------------------
AecMgdReverse
    Assembly Version: 6.5.353.0
    Win32 Version: 6, 5, 353, 0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AecMgdReverse.DLL
----------------------------------------
AecRibbon
    Assembly Version: 6.5.353.0
    Win32 Version: 6.5.353.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AecRibbon.DLL
----------------------------------------
AcMapResourceManagement
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcMapResourceManagement.DLL
----------------------------------------
AcMapSurveyMan
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcMapSurveyMan.DLL
----------------------------------------
Autodesk.Gis.Map.SurveyUI
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/Autodesk.Gis.Map.SurveyUI.DLL
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5446 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
Autodesk.Gis.Map.Survey
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/Autodesk.Gis.Map.Survey.DLL
----------------------------------------
Autodesk.Map.Platform.Core
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/Autodesk.Map.Platform.Core.DLL
----------------------------------------
OSGeo.MapGuide.PlatformBase
    Assembly Version: 2.2.0.4206
    Win32 Version: 1.0.0.4206
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/OSGeo.MapGuide.PlatformBase.DLL
----------------------------------------
OSGeo.MapGuide.Foundation
    Assembly Version: 2.2.0.4206
    Win32 Version: 1.0.0.4206
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/OSGeo.MapGuide.Foundation.DLL
----------------------------------------
OSGeo.MapGuide.Geometry
    Assembly Version: 2.2.0.4206
    Win32 Version: 1.0.0.4206
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/OSGeo.MapGuide.Geometry.DLL
----------------------------------------
Autodesk.Gis.Map.Survey.Resource
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/Autodesk.Gis.Map.Survey.Resource.DLL
----------------------------------------
AcMapRibbonWrapper
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcMapRibbonWrapper.DLL
----------------------------------------
Autodesk.Gis.Map.Shared
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/Autodesk.Gis.Map.Shared.DLL
----------------------------------------
AmbercoreEngine
    Assembly Version: 0.0.0.0
    Win32 Version: 18.1.49.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AmbercoreEngine.DLL
----------------------------------------
AmberCore.IsdCodecAPI.Core
    Assembly Version: 5.0.0.343
    Win32 Version: 5.0.0.343
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AmberCore.IsdCodecAPI.Core.DLL
----------------------------------------
AeccMgdReverse
    Assembly Version: 0.0.0.0
    Win32 Version: 8,0,2222,0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AeccMgdReverse.DLL
----------------------------------------
AeccUiWindows
    Assembly Version: 8.0.2222.0
    Win32 Version: 8.0.2222.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AeccUiWindows.DLL
----------------------------------------
AeccUiWindows.resources
    Assembly Version: 8.0.1439.0
    Win32 Version: 8.0.1439.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/en-US/AeccUiWindows.resources.DLL
----------------------------------------
AeciRibbon54Res
    Assembly Version: 18.1.15.1
    Win32 Version: 18.1.015.1
    CodeBase: file:///C:/Program%20Files/adsk_raster_design_2011/AeciRibbon54res.dll
----------------------------------------
Redland.NET
    Assembly Version: 0.9.17.6
    Win32 Version: 0.9.17.6
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/Redland.NET.DLL
----------------------------------------
ContextualTabSelectorRules
    Assembly Version: 0.0.0.0
    Win32 Version: 18.1.208.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcWindows.dll
----------------------------------------
AeccWindows
    Assembly Version: 8.0.2222.0
    Win32 Version: 8.0.2222.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AeccWindows.DLL
----------------------------------------
AeccDbMgd
    Assembly Version: 8.0.2222.0
    Win32 Version: 8,0,2222,0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AeccDbMgd.DLL
----------------------------------------
AecBaseMgd
    Assembly Version: 6.5.353.0
    Win32 Version: 6, 5, 353, 0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AecBaseMgd.DLL
----------------------------------------
ManagedMC3
    Assembly Version: 4.11.0.0
    Win32 Version: 4.12.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/ManagedMC3.DLL
----------------------------------------
9w5jbjmj
    Assembly Version: 3.0.270.0
    Win32 Version: 2.0.50727.5453 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
AcLayer
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.208.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcLayer.DLL
----------------------------------------
AcLayer.resources
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.49.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/en-US/AcLayer.resources.DLL
----------------------------------------
AeccUiMgd
    Assembly Version: 8.0.2222.0
    Win32 Version: 8,0,2222,0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AeccUiMgd.DLL
----------------------------------------
UIAutomationProvider
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.4902 built by: NetFXw7
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/UIAutomationProvider/3.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
----------------------------------------
Accessibility
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.4927 (NetFXspW7.050727-4900)
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
AcCommandToolTips
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.49.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AcCommandToolTips.DLL
----------------------------------------
AcCommandToolTips.resources
    Assembly Version: 18.1.0.0
    Win32 Version: 18.1.49.0.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/en-US/AcCommandToolTips.resources.DLL
----------------------------------------
VerticalTips
    Assembly Version: 14.0.206.0
    Win32 Version: 14.0.206.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/VerticalTips.DLL
----------------------------------------
AeccUiTooltipContent
    Assembly Version: 8.0.2222.0
    Win32 Version: 8.0.2222.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/AeccUiTooltipContent.DLL
----------------------------------------
AeccUiTooltipContent.resources
    Assembly Version: 8.0.1439.0
    Win32 Version: 8.0.1439.0
    CodeBase: file:///C:/Program%20Files/adsk_c3d_2011/en-US/AeccUiTooltipContent.resources.DLL
----------------------------------------
PresentationUI
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.4902 built by: NetFXw7
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationUI/3.0.0.0__31bf3856ad364e35/PresentationUI.dll
----------------------------------------
PresentationFramework.Luna
    Assembly Version: 3.0.0.0
    Win32 Version: 3.0.6920.5011 built by: Win7SP1
    CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/PresentationFramework.Luna/3.0.0.0__31bf3856ad364e35/PresentationFramework.Luna.dll
----------------------------------------
C3D StyleTools
    Assembly Version: 0.0.0.0
    Win32 Version: 0.0.0.0
    CodeBase: file:///C:/_remote_drives/R/cad/support/water/common/app/style_tools/C3D%20StyleTools.dll
----------------------------------------
************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.
For example:
   
When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

**** Hidden Message *****

Jeff_M 发表于 2012-3-27 09:49:56

这是32位安装吗?您是否仍在使用修改后的acad.exe。配置?是否所有图形都出现此错误?

BlackBox 发表于 2012-3-27 10:05:04

64位(Windows 7),OOTB acad.exe。配置,并且不会对每个图形都失败
如果未指定QNEW,C3D是否默认为acad。dwt?我确实确认了2011年的配置文件没有将DWT设置为QNEW,而2012年则设置为如上所述的NCS。2012年有效,不是2011年…模板可能是我的问题。

BlackBox 发表于 2012-3-27 10:08:18

额外的测试表明,我们的公司模板也失败了,但我一直在准备的模板没有...我使用“_AutoCAD Civil 3D(英制)NCS.dwt”作为起点。不确定公司模板。
编辑-没有意义的是,即使在acad.dwt中也有样式...虽然是“标准”的,但它们确实存在。为什么代码会因为样式来自acad.dwt而在“获取计数”时失败?

Jeff_M 发表于 2012-3-27 10:15:42

好的,我可以通过将我的QNEW样板更改为“无”来复制该错误,然后选择acad3d.dwt来开始新的图形。不知道为什么这些通用dwt会被用来启动C3D绘图,但我会看看是否有一种方法来解决这个问题。

BlackBox 发表于 2012-3-27 10:25:06

确认问题是模板,而不是

Jeff_M 发表于 2012-3-27 10:30:42

看来问题是图纸给佛

huiz 发表于 2012-3-27 10:34:22

如果使用没有样式的模板,则可能没有样式集合,因此无法使用count方法
您最好先检查是否有任何样式集合
尝试将tmpCounter设置为整数
tmpCounter=
。将Catch ex计算为Autodesk.Civil。CivilException<br>有些错误,没有样式

结束尝试

Jeff_M 发表于 2012-3-27 10:40:46

是的,现在通过增加2行代码就可以了....私有静态void list collection(Type object Type,PropertyInfo pf,object myStylesRoot)。
{。

对象资源=对象类型,InvokeMember(pf,姓名,。
绑定标记,GetProperty,null,myStylesRoot,new object);。
if (res.Equals(null))。
返回;。

StyleCollectionBase sc base =(StyleCollectionBase)RES;。
//添加以下内容以消除集合尚未初始化时引发的错误。
试试{ int i = scBase,数数;}。
catch { return}。

foreach(sc base中的ObjectId sbid)。
{.......。
我在原始主题中添加了一条带有附件的消息。

airportman 发表于 2021-1-5 12:18:02

杰夫-自2012版以来,您是否为此创建了更新dll
我正在寻找将C3D模板内容导出为CSV或其他数据库类型格式的方法
正在尝试构建用于跟踪的框架文档。
页: [1] 2
查看完整版本: Civil 3D样式|获取计数失败