但同样,这可能会导致错误,因为每次都必须正确格式化文件名。
我提出这一点的唯一原因是,我以前工作的公司保存了每张图纸,文件名不仅包含图纸编号,还包含项目编号、项目名称、修订号和图纸标题。因此,我认为这是一个可能的解决方案。 供应链上下的合作与协调可以提高许多领域的效率。将文件命名结构修改为商定的标准肯定是一个良好的开端。 嗨,大家好,我昨晚完成了工作,并且成功了。它基本上允许您选择4个多行文字,然后创建一个excel表并保存它,然后使其可见。然后,它将四个选定字段传输到avitve excel表,然后提供活动单元格,然后再将下一个文本字符串传输到当前活动单元格。我在代码中内置了一个部分,如果您没有选择任何值,它将结束子部分。这允许用户移动到不同的布局或图形,然后重新启动sub。选择四个多行文字,然后再次添加到活动单元格。
我将寻找整合seants代码,这样它就可以让你选择属性,文本或多行文字。我想我必须写3个ocde变体来解释不同的类型。我想写的另一部分是允许用户选择所选实体的数量。将代码设置为在excel工作表中输入四个值后转到下一行。我希望允许用户在commnad行中键入金额,因为人们的模板可能不同,有时项目编号是图纸的一部分,不意味着需要3个实体来选择
如。
项目编号图纸编号
利润
标题
其他时候有四种选择
项目编号
图纸编号
利润
标题
我很高兴,我知道这将节省我很多时间。
它的一个问题是它有一个bug。似乎每一次代码运行时,值被传输到excel的部分就会崩溃。我完成的时候真的很晚了,所以稍后我会再看一遍,因为我确信这很简单。再次原谅代码,如果它看起来有点凌乱,我会看看,看看我是否可以简化它,使它更容易阅读,但在这一刻,它的工作,所以这始终是我的首要目标。
请发表评论。
下一篇文章中的代码。
干杯
col公司
ps我同意你seant
但我不是要求这些东西的人。我们是一家幕墙铝玻璃公司,我们收到的图纸来自建筑师。这些人在食物链中处于较高的位置,所以我只能忍受,并想出解决问题的方法。
Public MyTxtStr(0 To 3) As String
Public Cnt As Integer
Public WorkbookOpen As Integer
Public RowCnt As Integer
Public ErrorHandler As Error
Public Excel As Excel.Application
Public ExcelSheet As Object
Public ExcelWorkbook As Object
Public CurrRange As Range
Sub DrgRecivedRegAutoComplete3()
'allows selecting text on screen
'stores thetextvalue
Dim MyMTxt As AcadMText
Dim MyoEnt As AcadEntity
Dim MyObjSS As AcadSelectionSet
Dim i As Double
i = 0
'
On Error Resume Next
ThisDrawing.SelectionSets("Selecttext").Delete
On Error Resume Next
Set MyObjSS = ThisDrawing.SelectionSets.Add("Selecttext") '' create a new selectionset
MyObjSS.SelectOnScreen '' let user select entities interactively
' ThisDrawing.Utility.prompt objSS.Count & " entities selected"
' ThisDrawing.Utility.GetString True, vbLf & "Enter to continue Escape To Exit"
MyObjSS.Highlight True
If MyObjSS.Count = "0" Then GoTo ErrorHandler
For Each MyoEnt In MyObjSS
If TypeOf MyoEnt Is AcadMText Then
Set MyMTxt = MyoEnt
MyTxtStr(i) = MyMTxt.TextString
MyObjSS.Highlight False
i = i + 1
End If
Next
Cnt = MyObjSS.Count - 1
Tranfer2Excel
ErrorHandler:
Close
End Sub
Private Sub Tranfer2Excel()
If WorkbookOpen = 1 Then GoTo SkipCreatingWorkbook
' Launch Excel.
Set Excel = New Excel.Application
' Create a new workbook and find the active sheet.
Set ExcelWorkbook = Excel.Workbooks.Add
Set ExcelSheet = Excel.ActiveSheet
ExcelWorkbook.SaveAs "Drawing Register Transfer Sheet.xls"
Excel.Visible = True
RowCnt = 1
With Worksheets("Sheet1")
.Select
.Range("a1").Activate
End With
SkipCreatingWorkbook:
For i = 0 To Cnt
Set CurrRange = ActiveCell
CurrRange.Value = MyTxtStr(i)
CurrRange.Offset(0, 1).Select
Next
RowCnt = RowCnt + 1
With Worksheets("Sheet1")
.Select
.Range("a" & RowCnt).Activate
End With
WorkbookOpen = 1
DrgRecivedRegAutoComplete3
' Excel.Application.Quit
'Excel.Application.
End Sub
我已经这样做了,用户选择一个对象,然后你知道它是块还是文本等在文本的情况下,你总是会选择第一个答案,然后下一个等,如果它是块和文本的混合选择,它会变得复杂。
答案
Hi Lee,
I was surfing the NET looking for inspiration and found the HOLLY GRAIL......
Is this at all possible? to transfer information from AutoCAD to an EXCEL Drawing Register using Attributes??
Any Assistance Would be Greatly Appteciated:shock:
Best Regards
Simon
Hi Lee,
Ihave tried to send a message twice giving a detailed description of my situation, unfortunately every time i hit the 'submit reply' button it takes me back to the login screen:oops:
To cut a long story short......
I was surfing the NET looking for inspiration and found the HOLLY GRAIL......
Is this at all possible? to transfer information from AutoCAD to an EXCEL Drawing Register using Attributes??
Any Assistance Would be Greatly Appteciated:shock:
Best Regards
Simon I am sure Lee will be along soon but you could also look at the data extraction tool already in AutoCAD. (Tools|Data Extraction) Simon, check out the Global Attribute Extractor in my sig - this thread is pretty old, but it looks like I accomplished it in the end
Hi LM
first a big thanks for your global efforts in the fight against Badcad.
I didn't want to start a new thread and found this one which I hope can get my question answered.
I am starting a new Project which will have over 100 drawings, all with the same title block containing attributed text. I have created an excel table with column headings representing each Attribute, and wish to have one row per drawing, thus creating a title-block table in Excel.
I wish to be able to fill in text for These attributes inside this table rather than have to open up individual drawings.
How can I create the link to make these title block attributes read Information from this table?
Kind of like your Global Attribute Extractor, but in reverse!
thanks in advance for any insight anyone can give me
页:
1
[2]