listing of all feature properties in a part

Discussion in 'SolidWorks' started by Ron van Dijk, Oct 3, 2003.

  1. Ron van Dijk

    Ron van Dijk Guest

    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
    web www.3de.nl
     
    Ron van Dijk, Oct 3, 2003
    #1
  2. Philippe Guglielmetti, Oct 3, 2003
    #2
  3. 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
     
    Jean Marc BRUN, Oct 3, 2003
    #3
  4. Ron van Dijk

    rocheey Guest

    Please let me know if there is a way to get a total
    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" ...
     
    rocheey, Oct 3, 2003
    #4
  5. Ron van Dijk

    Ron van Dijk Guest

    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
    web www.3de.nl
     
    Ron van Dijk, Oct 3, 2003
    #5
  6. 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 ;-)
    --
    Philippe Guglielmetti - www.dynabits.com

    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <DOCUMENT><PROP NAME="Copyright" VALUE="Maxwell-Chase in Douglasville,
    Georgia (USA)"/>
    <PROP NAME="Courtesy of" VALUE="Mark Stapleton, Charlotte, North Carolina"/>
    <PROP NAME="Description" VALUE="a very complex part"/>
    <PROP NAME="MakeOrBuy" VALUE="Make"/>
    <PROP NAME="CheckedBy" VALUE="Ph. Guglielmetti, DynaBits"/>
    <PROP NAME="Project" VALUE="Test part for AssyGator"/>
    <PROP NAME="CompanyName" VALUE="DynaBits"/><CONFIG NAME="Default">
    <FEATURE NAME="Annotations" TYPE="DetailCabinet">

    </FEATURE>
    <FEATURE NAME="Lighting" TYPE="EnvFolder">
    <SUB NAME="Ambient"/>
    <SUB NAME="Directional1"/>
    </FEATURE>
    <FEATURE NAME="Surface Bodies" TYPE="UNKNOWN">

    </FEATURE>
    <FEATURE NAME="Solid Bodies" TYPE="UNKNOWN">

    </FEATURE>
    <FEATURE NAME="Front" TYPE="RefPlane">

    </FEATURE>
    <FEATURE NAME="Top" TYPE="RefPlane">

    </FEATURE>
    <FEATURE NAME="Right" TYPE="RefPlane">

    </FEATURE>
    <FEATURE NAME="Origin" TYPE="OriginProfileFeature">

    </FEATURE>
    <SKETCH NAME="Sketch1">
    <BASE PLANE="Front"/><POINT NAME="Point20" x="0.023" y="0.023"/>
    <POINT NAME="Point13" x="0.2363848" y="0.077355400"/>
    <POINT NAME="Point9" x="0.023" y="0.077355400"/>
    <POINT NAME="Point16" x="0.2363848" y="0.023"/>
    <POINT NAME="Point7" x="0.023" y="0.1003554"/>
    <POINT NAME="Point8" x="0" y="0.077355400"/>
    <POINT NAME="Point6" x="0" y="0.1003554"/>
    <POINT NAME="Point11" x="0.2593848" y="0.077355400"/>
    <POINT NAME="Point12" x="0.2363848" y="0.1003554"/>
    <POINT NAME="Point10" x="0.2593848" y="0.1003554"/>
    <POINT NAME="Point14" x="0.2593848" y="0.023"/>
    <POINT NAME="Point15" x="0.2363848" y="0"/>
    <POINT NAME="Point18" x="0.023" y="0"/>
    <POINT NAME="Point19" x="0" y="0.023"/>
    <POINT NAME="Point17" x="0" y="0"/>
    <POINT NAME="Point5" x="0" y="0"/>
    <CONTOUR>
    <SEGMENT TYPE="ARC" NAME="Arc3" LENGTH="0.036128316">
    <CENTER NAME="Point16"/><START NAME="Point14"/><END NAME="Point15"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line1" LENGTH="0.2133848">
    <START NAME="Point18"/><END NAME="Point15"/>
    </SEGMENT>
    <SEGMENT TYPE="ARC" NAME="Arc4" LENGTH="0.036128316">
    <CENTER NAME="Point20"/><START NAME="Point18"/><END NAME="Point19"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line2" LENGTH="0.0543554">
    <START NAME="Point19"/><END NAME="Point8"/>
    </SEGMENT>
    <SEGMENT TYPE="ARC" NAME="Arc1" LENGTH="0.036128316">
    <CENTER NAME="Point9"/><START NAME="Point7"/><END NAME="Point8"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line3" LENGTH="0.2133848">
    <START NAME="Point7"/><END NAME="Point12"/>
    </SEGMENT>
    <SEGMENT TYPE="ARC" NAME="Arc2" LENGTH="0.036128316">
    <CENTER NAME="Point13"/><START NAME="Point11"/><END NAME="Point12"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line4" LENGTH="0.0543554">
    <START NAME="Point14"/><END NAME="Point11"/>
    </SEGMENT>
    </CONTOUR><DIMENSION NAME="D1" TYPE="LIN" VALUE="0.1003554">
    <REF NAME="Point17"/>
    <REF NAME="Point6"/>
    </DIMENSION>
    <DIMENSION NAME="D2" TYPE="LIN" VALUE="0.2593848">
    <REF NAME="Point6"/>
    <REF NAME="Point10"/>
    </DIMENSION>
    <DIMENSION NAME="D3" TYPE="RAD" VALUE="0.023">
    <REF NAME="Arc1"/>
    </DIMENSION>
    </SKETCH>
    <FEATURE NAME="Base-Extrude" TYPE="Extrusion">
    <SUB NAME="Sketch1"/><DIMENSION NAME="D1" TYPE="LIN"
    VALUE="0.012"></DIMENSION>
    <DIMENSION NAME="D3" TYPE="ANG" VALUE="0.104719755"></DIMENSION>
    </FEATURE>
    <SKETCH NAME="Sketch2">
    <BASE>
    <OBJECT NAME="" TYPE="FACE"/>
    </BASE><POINT NAME="Point61" x="0.023" y="0.002761251"/>
    <POINT NAME="Point62" x="0.2363848" y="0.002761251"/>
    <POINT NAME="Point64" x="0.2363848" y="0.023"/>
    <POINT NAME="Point63" x="0.256623549" y="0.023"/>
    <POINT NAME="Point65" x="0.256623549" y="0.077355400"/>
    <POINT NAME="Point67" x="0.2363848" y="0.077355400"/>
    <POINT NAME="Point66" x="0.2363848" y="0.097594149"/>
    <POINT NAME="Point68" x="0.023" y="0.097594149"/>
    <POINT NAME="Point70" x="0.023" y="0.077355400"/>
    <POINT NAME="Point69" x="0.002761251" y="0.077355400"/>
    <POINT NAME="Point71" x="0.002761251" y="0.023"/>
    <POINT NAME="Point72" x="0.023" y="0.023"/><CONTOUR>
    <SEGMENT TYPE="ARC" NAME="Arc19" LENGTH="0.031790953">
    <CENTER NAME="Point70"/><START NAME="Point68"/><END NAME="Point69"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line20" LENGTH="0.0543554">
    <START NAME="Point69"/><END NAME="Point71"/>
    </SEGMENT>
    <SEGMENT TYPE="ARC" NAME="Arc20" LENGTH="0.031790953">
    <CENTER NAME="Point72"/><START NAME="Point71"/><END NAME="Point61"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line17" LENGTH="0.2133848">
    <START NAME="Point61"/><END NAME="Point62"/>
    </SEGMENT>
    <SEGMENT TYPE="ARC" NAME="Arc17" LENGTH="0.031790953">
    <CENTER NAME="Point64"/><START NAME="Point62"/><END NAME="Point63"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line18" LENGTH="0.0543554">
    <START NAME="Point63"/><END NAME="Point65"/>
    </SEGMENT>
    <SEGMENT TYPE="ARC" NAME="Arc18" LENGTH="0.031790953">
    <CENTER NAME="Point67"/><START NAME="Point65"/><END NAME="Point66"/>
    </SEGMENT>
    <SEGMENT TYPE="LINE" NAME="Line19" LENGTH="0.2133848">
    <START NAME="Point66"/><END NAME="Point68"/>
    </SEGMENT>
    </CONTOUR><DIMENSION NAME="D1" TYPE="LIN" VALUE="0.0015"></DIMENSION>
    </SKETCH>
    <FEATURE NAME="Boss-Extrude1" TYPE="Boss">
    <SUB NAME="Sketch2"/><DIMENSION NAME="D1" TYPE="LIN"
    VALUE="0.080199999"></DIMENSION>
    <DIMENSION NAME="D3" TYPE="ANG" VALUE="0.087266463"></DIMENSION>
    </FEATURE>
    <FEATURE NAME="Chamfer5" TYPE="Chamfer">
    <DIMENSION NAME="D1" TYPE="LIN" VALUE="0.0015"></DIMENSION>
    <DIMENSION NAME="D2" TYPE="ANG" VALUE="0.785398163"></DIMENSION>
    </FEATURE>
     
    Philippe Guglielmetti, Oct 3, 2003
    #6
  7. Ron van Dijk

    rocheey Guest

    Will take anything better

    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 ------
     
    rocheey, Oct 6, 2003
    #7
  8. Ron van Dijk

    Tony O'Hara Guest

    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, Oct 9, 2003
    #8
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.