阅读:1457回复:2
关于ao读取dxf文件的问题
<P>下面是一段ao读取dxf文件的代码,有些不明白的地方,期待高手指点</P>
<P>Do<BR> strLine = m_StreamReader.ReadLine<BR> If Trim(strLine.ToUpper) = "ENTITIES" Then<BR> m_bStarted = True<BR> End If<BR> If Trim(strLine.ToUpper) = "LWPOLYLINE" And Trim(strOldLine) <> "999" And m_bStarted Then '''标记一个实体的开始<BR> ''读取一个实体的几何和属性信息<BR> strHandle = ""<BR> strOldLine = ""<BR> Do<BR> strLine = m_StreamReader.ReadLine<BR> If Trim(strLine) = "360" And Trim(strOldLine.ToUpper) = "{ACAD_XDICTIONARY" Then<BR> strHandle = Trim(m_StreamReader.ReadLine)<BR> End If<BR> strOldLine = strLine<BR> Loop Until (Trim(strLine.ToLower) = "acdbentity" Or Trim(strLine.ToUpper) = "ENDSEC")<BR> Do<BR> strLine = m_StreamReader.ReadLine<BR> Loop Until (Trim(strLine.ToLower) = "acdbpolyline" Or Trim(strLine.ToUpper) = "ENDSEC")<BR> Dim strSymbol As String<BR> Dim strValue As String<BR> '’获取坐标信息<BR> Do<BR> strSymbol = m_StreamReader.ReadLine<BR> If Trim(strSymbol) = "0" Then<BR> Exit Do<BR> End If<BR> strValue = m_StreamReader.ReadLine<BR> If Trim(strSymbol) = "70" Then<BR> If Trim(strValue) = "1" Or Trim(strValue) = "129" Then<BR> m_pEntityAndXRcord.Closed = True<BR> Else<BR> m_pEntityAndXRcord.Closed = False<BR> End If<BR> ElseIf Trim(strSymbol) = "10" Then ''X坐标<BR> m_intPointCount += 1<BR> ReDim Preserve m_pEntityAndXRcord.Coordinates(1, m_intPointCount)<BR> m_pEntityAndXRcord.Coordinates(0, m_intPointCount) = strValue<BR> ElseIf Trim(strSymbol) = "20" Then ''Y坐标<BR> m_pEntityAndXRcord.Coordinates(1, m_intPointCount) = strValue<BR> End If<BR> Loop Until (Trim(strSymbol) = "0" Or Trim(strValue.ToUpper) = "ENDSEC")<BR> '’获取属性信息<BR> <BR> End If<BR> strOldLine = strLine<BR> Loop Until Trim(strLine.ToLower) = "eof"</P> <P>LWPOLYLINE</P> <P>"999"</P> <P>"360" "acdbentity" "acdbpolyline" </P> <P>在dxf文件中读到这些值代表什么意思啊,</P> <P>还有哪个标志标识该要素类是点,面还是线啊,期待高手指点</P> |
|
1楼#
发布于:2006-07-19 04:43
<P>以上代码不是 Ao读取dxf 的。</P>
<P>这个是自己写的读取 dxf文件的代码。 </P> <P>dxf 文件是CAD公司 定义的一个 通用的图形交换文件。它的文件定义格式你可以到 晓东CAD 或者 明经上去找。</P> <P>他基本上是 一个标记(告诉你下面保存的是什么信息) 对应一个 相应的值。</P> |
|
2楼#
发布于:2006-07-20 13:10
的确是我们公司以前的人写的啊,大致明白,但还有很多细节不明白,我到明经去查了很多资料,但还是对这个有些不了解,不知兄台对dxf格式熟悉否
|
|