View Full Version : SSM & Clients
ZenCad1960
1st Aug 2008, 03:33 pm
Good Morning,
It is a known fact now that the Sheet Set Manager (SSM) is a powerful tool in helping control consistency and managing repetitive dat in a large set of drawings.
One thing I am looking into is how can the fields in a drawing that are pulling information from the SSM be converted across the board to either just simple text.
The situation is that even though the SSM helps us keep all the information in our borders organized within our firm, it does nothing for the client when he gets the electronics from us at the end of the job. THe fields are all place holders when they open the drawings.
So here is the question: Is there a solution, either through SSM or other means (VBA, LISP, Script) that will convertall all the fields into standatd test much like the 'Explode Attributes To Text' feature for blocks?
Anyone else having this situation? The client does not want nor need to use the SSM so there is no other solution that finding a way to convert.
Thanks for all your help in andvance!
Zen
iTijn
2nd Aug 2008, 12:30 pm
This should do it for all you blocks
If you have TEXT or MTEXT with fieldcodes in your drawing you can do a similar thing.
Hope this helps,
Sub FieldCodes2Text()
Dim Answer As VbMsgBoxResult
Answer = VBA.MsgBox("Are you sure you want to convert ALL FieldCodes to Text???", vbYesNo, "Exploding block & Attributes to text")
If Answer = vbNo Then GoTo DoNotConvert
Dim Block As AcadBlockReference
Dim Attribs As Variant
Dim Value As String
Dim i As Long
Dim AllBlocks As AcadSelectionSet
Set AllBlocks = getAllInsertBlocksSSet("allblocks")
For Each Block In AllBlocks
If Block.HasAttributes Then
hendel = Block.Handle
Attribs = Block.GetAttributes
For i = LBound(Attribs) To UBound(Attribs)
Value = Attribs(i).TextString
Attribs(i).TextString = "" 'for some reason the string must first be cleared to remove the link.
Attribs(i).TextString = Value
Attribs(i).Update
Next i
End If 'has attributes
Block.Update
Next Block
DoNotConvert:
End Sub
Function getSSet(sname_ As String, dxfCode() As Integer, dxfData As Variant, onScreen As Boolean) As AcadSelectionSet
Dim sel As AcadSelectionSets
Dim sset As AcadSelectionSet
Set sel = ThisDrawing.SelectionSets
On Error Resume Next
Set sset = sel.Add(sname_)
If Err Then
Set sset = sel.Item(sname_)
sset.Clear
Err.Clear
End If
If onScreen = True Then
sset.SelectOnScreen dxfCode, dxfData
'sset.Select acSelectionSetPrevious, , , DXFcode, DXFdata
Else
sset.Select acSelectionSetAll, , , dxfCode, dxfData
End If
Set getSSet = sset
End Function
Function getAllInsertBlocksSSet(setname_ As String, Optional onScreen As Boolean) As AcadSelectionSet
Dim dxfCode(0 To 0) As Integer
Dim dxfData(0 To 0) As Variant
dxfData(0) = "INSERT"
Set getAllInsertBlocksSSet = getSSet(setname_, dxfCode, dxfData, onScreen)
End Function
rustysilo
2nd Aug 2008, 02:55 pm
If my memory serves me correctly all the fields would hold their last saved values when you send the files away. They shouldn't have any problems with that...
iTijn
2nd Aug 2008, 03:04 pm
If my memory serves me correctly all the fields would hold their last saved values when you send the files away. They shouldn't have any problems with that...
True, but sometimes you don't want values to update when they leave your office, (like version date, last edited by, etc...).
ZenCad1960
4th Aug 2008, 06:06 pm
This should do it for all you blocks
If you have TEXT or MTEXT with fieldcodes in your drawing you can do a similar thing.
Hope this helps,
Thanks for that code. However the fields we have are not in blocks but rather in the individual drawings as text fields. Do you have something that can convert these?
Thanks so much.
rustysilo
5th Aug 2008, 12:12 am
Ahh I see. Have you tried grabbing them all and just right-click > convert field to text?
ZenCad1960
5th Aug 2008, 12:23 am
I have over 200 drawings. I was hoping something along the lines of a batch routine via script or something....this is frustrating to be sure....
Thanks. If anyone has an idea on how to batch these either by script or VBA or even .net, that would be fantastic....
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.