listing of all feature properties in a part

Dear All,
Please let me know if there is a way to get a total
feature properties listing of a part in one go.
I do know that per feature this is possible, but now
for all together?
Greetings,
Ron van Dijk
van Dijk 3D Engineering bv
Midden Engweg 2a
3882 TT Putten
tel. +31 (0)341 416594
fax. +31 (0)341 416764
mob. +31 (0)6 54652256
e-mail snipped-for-privacy@3de.nl
web
formatting link

Reply to
Ron van Dijk
Loading thread data ...
our AssyGator add-in documents parts and assemblies
formatting link
.It generates a list of features with some properties. See
formatting link
for an example. Tell me if you need something more.
Reply to
Philippe Guglielmetti
"Ron van Dijk" a écrit dans le message de news: bljfbp$h9d$ snipped-for-privacy@news2.solcon.nl...
What I do is make a prinscreen, paste in Paint, cut the desired part of the screen (features), paste in a new paint image.
Will take anything better
HIH
JM
Reply to
Jean Marc BRUN
Maybe you can elaborate a little better? It is possible for a macro to parse down the feature manager tree, and recurse subfeatures. But Im noit sure what is meant by "Total Feature Properties" ...
Reply to
rocheey
Dear All,
To be more specific.
When you use your right mouse when pointing to a feature in the feature tree, one can get a window on the feature properties.
What I want is a feature property listing of the whole part in one list without having to do this with every feature manually.
We use this when we recieve parts made by other engineers or firms and there are major problems with the file. This way we get a good overview when what was made and by whom.
Anybody?!
Greetings,
Ron van Dijk
van Dijk 3D Engineering bv Midden Engweg 2a 3882 TT Putten
tel. +31 (0)341 416594 fax. +31 (0)341 416764 mob. +31 (0)6 54652256 e-mail snipped-for-privacy@3de.nl web
formatting link

Reply to
Ron van Dijk
We intend to develop AssyGator in the direction you mention. We currently work on "cadml", an XML format that would allow to completely describe cad models as features. Below is a part of a cadml file. As you can see, all dimensions of features are listed in it, so it would be "easy" to extract them with XSLT to generate an HTML list of the features with dimensions. We're looking for sponsors to continue this project. Tell me how much you're ready to pay ;-)
Reply to
Philippe Guglielmetti
Well, the XML output is the way to go. But if you are as cheap as I am, (or maybe your boss is), this macro will dump a text-only version to a temp file and pop it up onscreen.
'---- snip ---------- snip ---------- snip ---------- snip ------
Declare Function GetTempPath Lib "kernel32" Alias "GetTempPathA" _ (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" _ (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, _ ByVal lpTempFileName As String) As Long
Sub main() Dim swApp As SldWorks.SldWorks Dim Part As SldWorks.ModelDoc2 Dim boolstatus As Boolean Dim longstatus As Long Dim Feature As SldWorks.Feature Dim subFeat As SldWorks.Feature Dim Config As SldWorks.configuration Dim SupprState As Boolean Dim OutPutStr As String Dim dirTemp As String, fileTemp As String
Const swDocPART = 1 ' Used to be TYPE_PART Set swApp = Application.SldWorks If swApp Is Nothing Then MsgBox "Please start Solidworks before running this macro" Exit Sub End If Set Part = swApp.ActiveDoc If Part Is Nothing Then MsgBox "Please have a part loaded" Exit Sub End If
MyPath$ = Part.GetPathName OutPutStr = "Document : " & MyPath$ & vbCrLf Set Config = Part.GetActiveConfiguration ConfigName$ = Config.Name OutPutStr = OutPutStr & "Feature History for:" & _ ConfigName$ & vbCrLf
Set Feature = Part.FirstFeature 'Get the 1st feature in part While Not Feature Is Nothing ' While we have a valid feature featureName = Feature.Name ' Get the name of the feature Creator$ = Feature.CreatedBy CreateDate$ = Feature.DateCreated Moddate$ = Feature.DateModified SupprState = Feature.IsSuppressed OutPutStr = OutPutStr & vbCrLf & featureName & " Created By: " & _
Creator$ & " on " & CreateDate$ & vbCrLf OutPutStr = OutPutStr & Chr$(9) & "Modified on " & Moddate$ & Chr$(9) & _ " Suppressed: " & SupprState & vbCrLf SubFeatMsg$ = Chr$(9) & featureName & " SubFeatures:" Set subFeat = Feature.GetFirstSubFeature If Not (subFeat Is Nothing) Then OutPutStr = OutPutStr _ & SubFeatMsg$ & vbCrLf
While Not subFeat Is Nothing ' While we have a valid _ Sub-feature ' Get the name of the Sub-feature subFeatureName$ = subFeat.Name Creator$ = subFeat.CreatedBy CreateDate$ = subFeat.DateCreated Moddate$ = subFeat.DateModified SupprState = subFeat.IsSuppressed OutPutStr = OutPutStr & Chr$(9) & Chr$(9) & _ subFeatureName$ & " Created By: " _ & Creator$ & " on " & CreateDate$ & vbCrLf OutPutStr = OutPutStr & Chr$(9) & Chr$(9) & _ "Modified on " & Moddate$ & _ " Suppressed: " & SupprState & vbCrLf Set subFeat = subFeat.GetNextSubFeature Wend ' Continue until the last Sub-feature is done Set Feature = Feature.GetNextFeature() Wend ' Continue until the last feature is done ' dump to temp file: first, get the path of the TEMP dir dirTemp = String(100, Chr$(0)): GetTempPath 100, dirTemp 'strip off the ascii zeroes dirTemp = Left$(dirTemp, InStr(dirTemp, Chr$(0)) - 1) ' add a trailing slash, if needed If Right(dirTemp, 1) "\" Then dirTemp = dirTemp & "\" ' get temp filename fileTemp = String(260, 0) ' Create a buffer GetTempFileName dirTemp, "SWX", 0, fileTemp 'Get tempname 'Remove all the unnecessary chr$(0)'s fileTemp = Left$(fileTemp, InStr(1, fileTemp, Chr$(0)) - 1) 'above returns the full filename and pathspec ' dump the contents to the temp file name/path we just generated tmpFile% = FreeFile Open fileTemp For Output As #tmpFile% Print #tmpFile%, OutPutStr Close #tmpFile ' Now pop the doc up in notepad RetCode = Shell("Notepad " & fileTemp, vbNormalFocus)
End Sub
'---- snip ---------- snip ---------- snip ---------- snip ------
Reply to
rocheey
I have a small program, that will traverse all the features and provide the data in a text box, this can then be copied and used elsewhere. Unfortunately, while I pull my hair out trying to get my new 120GB drive installed, I have unloaded VB and SWX, so I cannot check if it my latest version. If you would like a copy, please email me.
-- Tony O'Hara Melbourne, Australia.
Reply to
Tony O'Hara

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.