how to get Component Description from API... please help

Discussion in 'SolidWorks' started by Derek Ciula, Dec 20, 2005.

  1. Derek Ciula

    Derek Ciula Guest

    Please, please, please, point me in the right direction.

    I have tried the help documents and online resources to no avail -
    (did you know the word "description" is in almost every help
    document?). Does anyone know either implicitly or theoretically how to
    retrieve a component's description?

    - Right clicking on a component in the feature manager
    - Select Component Properties
    - Component Description is the value I am looking to lay my hands upon.

    The following methods return " " (empty set) for all components I
    loop thru:

    CompDescr = ModDoc.CustomInfo2({variable for current configuration},
    "DESCRIPTION")
    CompDescr = ModDoc.CustomInfo2("", "DESCRIPTION")

    Where
    ModDoc = Component2.GetModelDoc() And
    Component2 initially is RootComponent, but recursively loops through
    all child components

    Greatly appreciated,
    Derek Ciula
     
    Derek Ciula, Dec 20, 2005
    #1
  2. Derek Ciula

    That70sTick Guest

    The ModDoc object as you define it no longer has any component
    properties; it is only the part (or assembly) without context.

    Custom property names are cASE sENSITIVE.

    Also of interest:
    ModelDoc2::SummaryInfo
    AssemblyDoc::FeatureByName (try getting component as a feature object)
    Feature::Description

    from help:
    Component descriptions appear only if you selected Description in
    Custom property used as custom description in the General system
    options. You can select a different item for Custom property used as
    custom description, but you must set a value for that custom property
    on the Custom tab of the Summary Information dialog box.
     
    That70sTick, Dec 20, 2005
    #2
  3. Derek Ciula

    Derek Ciula Guest

    I don't suppose you could tell me how to define an Object that would
    retain component properties?

    But thanks for info,
    This will at least give me a few more leads to dig around in.

    I can get Model Document Path, which is the field directly below, the
    Component Property(what i'm looking for)

    with the following code:
    ModDoc.GetPathName

    would it be overly hopeful that there's a ModDoc.GetDescription ? or
    something similar?
    Thanks,
    Derek
     
    Derek Ciula, Dec 20, 2005
    #3
  4. Derek Ciula

    Derek Ciula Guest

    The buck stops with case sensitive config types...
    I changed DESCRIPTION to Description and everything what happy.

    Thank you very much Mr70's
    I don't suppose you live in WI? I'll send you a christmas present for
    your help.
     
    Derek Ciula, Dec 20, 2005
    #4
  5. Derek Ciula

    That70sTick Guest

    Lived in WI most of my life. there's a reason "That 70's Show" is set
    in Wisconsin: the 70's never really left!
     
    That70sTick, Dec 21, 2005
    #5
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.