chskypei 发表于 2006-3-19 14:45:00

(求助)vba编程的问题,请大家帮我

采用VBA输出的图纸,为什么尺寸界线在折线段上时会节节升高,数个垂直线的尺寸界线会集中到一起?C:\Documents and Settings\Administrator\My Documents\My Pictures\VBA输出的图纸

雪山飞狐_lzh 发表于 2006-3-19 15:29:00

<P>图呢?</P>
<P>有可能的话把你的测试代码贴上</P>

chskypei 发表于 2006-3-19 21:09:00

<P><FONT color=#ff0000><FONT color=#000000>采用VBA输出的图纸,为什么尺寸界线在折线段上时会节节升高,数个垂直线的尺寸界线会集中到一起?</FONT></FONT></P>
<P>操作错误,上午忘了贴图,惭愧,请版主谅解</P>
<P><FONT color=#ff0000>C:\Documents and Settings\Administrator\My Documents\My Pictures\VBA输出的图纸.gif</FONT></P>
<P><FONT color=#ff0000>下边是部分代码,显示尺寸界线节节升高的部分和集中的部分(左侧),需要怎么做才能控制尺寸界线的长度(或高度):</FONT></P>
<P>&nbsp;&nbsp;&nbsp; kEndPoint(0) = 0<BR>&nbsp;&nbsp;&nbsp; kEndPoint(1) = 0<BR>&nbsp;&nbsp;&nbsp; kEndPoint(2) = 0<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;&nbsp;&nbsp; location(0) = 50<BR>&nbsp;&nbsp;&nbsp; location(1) = 10<BR>&nbsp;&nbsp;&nbsp; location(2) = 0<BR>&nbsp; </P>
<P>&nbsp;&nbsp;&nbsp; For i = 0 To Dot.Lowest<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cStartPoint(0) = cEndPoint(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cStartPoint(1) = cEndPoint(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cStartPoint(2) = cEndPoint(2)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cEndPoint(0) = XLen(i) + cStartPoint(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cEndPoint(1) = cStartPoint(1) - bData(i)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cEndPoint(2) = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set lineObj = ThisDrawing.ModelSpace.AddLine(cStartPoint, cEndPoint)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(cStartPoint, cEndPoint, location)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; If i &gt; 0 Then<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kEndPoint(0) = cStartPoint(0)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kEndPoint(1) = cStartPoint(1) - kData(i - 1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; kEndPoint(2) = 0<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set lineObj = ThisDrawing.ModelSpace.AddLine(cStartPoint, kEndPoint)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Set dimObj = ThisDrawing.ModelSpace.AddDimAligned(cStartPoint, kEndPoint, location)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; End If<BR>&nbsp;&nbsp; Next<BR></P>

雪山飞狐_lzh 发表于 2006-3-19 21:18:00

AddDimAligned的第三个参数是文字位置的三维WCS坐标,你怎么循环里都一样的?

syqtm 发表于 2006-9-8 21:26:00

查清了吧,循环出了问题?
页: [1]
查看完整版本: (求助)vba编程的问题,请大家帮我