[求助]
<P>各位大虾:</P><P>为什么没人理我?现在各位大虾的豪爽都到哪里去了?请帮个忙吧,为什么我这段程序运行时能通过,就是不给我在CAD下画多义线?</P> <P>你的程序在哪里呢?</P> <P>你好:我的程序在此:</P>
<P>Private Sub Command1_Click()<BR> On Error Resume Next<BR> Dim acadApp As AcadApplication<BR> Set acadApp = GetObject(, "AutoCAD.Application")<BR> acaApp.Command = script.exe<BR> If Err Then<BR> Err.Clear<BR> Set acadApp = CreateObject("AutoCAD.Application")<BR> If Err Then<BR> MsgBox Err.Description<BR> Exit Sub<BR> End If<BR> End If<BR>Dim plineobj As Autocad.AcadLWPolyline<BR> Dim points(0 To 5) As Double<BR> points(0) = 1: points(1) = 1<BR> points(2) = 100: points(3) = 100<BR> points(4) = 200: points(5) = 200<BR> Set plineobj = acadApp.ActiveDocument.ModelSpace.AddlightweightLWPolyline(points)<BR> plineobj.Closed = ture<BR> ZoomExtents<BR> ZoomAll<BR>acadApp.Visible = True<BR>End Sub</P>
<P>谢谢你!总算有侠义之士了</P> <P>改好了,:)</P>
<P> On Error Resume Next<BR> Dim acadApp As AcadApplication<BR> Dim acaddoc As AcadDocument<BR> Set acadApp = GetObject(, "AutoCAD.Application")<BR>' acaApp.Command = script.exe<BR> If Err Then<BR> Err.Clear<BR> Set acadApp = CreateObject("AutoCAD.Application")<BR> Set acaddoc = acadApp.ActiveDocument<BR> acadApp.Visible = True<BR> If Err Then<BR> MsgBox Err.Description<BR> Exit Sub<BR> End If<BR> End If<BR>Dim Plineobj As AcadLWPolyline<BR> Dim points(0 To 5) As Double<BR> points(0) = 1: points(1) = 1<BR> points(2) = 100: points(3) = 100<BR> points(4) = 200: points(5) = 200<BR> Set Plineobj = acaddoc.ModelSpace.AddLightWeightPolyline(points)<BR> Plineobj.Closed = ture<BR> ZoomExtents<BR> ZoomAll</P>
<P>End Sub<BR></P> <P>真的很好用,谢谢呀!热心的大虾能留个联系方式么?好以后向你请教问题,不过在上面的问题中您能否解释一下为什么要加这些呢?是在不好意思,我还有个问题请教:我编写两段段插块的程序,圆我能插到指定点,为什么线的不能?程序如下: </P>
<P>'创建直线块<BR> Dim sblockobj(0) As AcadBlock<BR> Dim insertionpoint(0 To 2) As Double<BR> insertionpoint(0) = 2014#: insertionpoint(1) = 1436.5: insertionpoint(2) = 0#<BR> Set sblockobj(0) = acadApp.ActiveDocument.Blocks.Add(insertionpoint, "lineblock") '创建直线块<BR> Dim stp0(0 To 2) As Double<BR> Dim enp0(0 To 2) As Double<BR> stp0(0) = 2014: stp0(1) = 1436.5: enp0(2) = 0<BR> enp0(0) = 2016: enp0(1) = 1436.5: enp0(2) = 0<BR> Set plnObj = acadApp.ActiveDocument.ModelSpace.AddLine(stp0, enp0)<BR> Dim sblockRefobj As AcadBlockReference<BR>insertionpoint(0) = 2014#: insertionpoint(1) = 1436.5: insertionpoint(2) = 0#<BR>Set sblockRefobj(0) = acadApp.ActiveDocument.ModelSpace.InsertBlock(insertionpoint, "lineblock", 1#, 1#, 1#, 0) '插入块</P>
<P>'插入直线块</P>
<P>insertionpoint(0) = 2038.8: insertionpoint(1) = 1436.5: insertionpoint(2) = 0#<BR>Set sblockRefobj(0) = acadApp.ActiveDocument.ModelSpace.InsertBlock(insertionpoint, "lineblock", 1#, 1#, 1#, 0) </P>
<P>为什么不能插到我指定的(2038.8,1436.5)点?</P>
<P>还有如果我想镜像很多对象时,我该怎么办?谢谢!</P>
<P>我的联系方式:E-mail:wfcst2004@163.com qq:46184430,您的那,能同您联系么?</P> <P>我的信箱:my9683@163.com</P> 朋友,你好,谢谢你的回复了,实在不好意思我上面的问题麻烦你再看一下好么?我插不到指定点(程序能通过,但在找不到所插的线) <P>你在定义块的时候是怎么定义的?</P> 就是创建块之间的--定义?我不知道你是怎样收费的?如果你有能力解决让我同时镜像很多内容的话,我可以付费?不过我知道这(同时镜像很多内容)很不好办?你必须让我知道你的实力,谢谢 <P>嗯,把你的要求写详细些,最好附上例图,寄到我的信箱,我的QQ:1161713,解决不了你的问题我也不好意思收费,呵~~</P>
页:
[1]