SelectById / SelectById2 (sw2004/sw2006 diff?)

Discussion in 'SolidWorks' started by DragonAtWork, Apr 3, 2006.

  1. DragonAtWork

    DragonAtWork Guest

    Appologies in advance if this is outdated...but I could find no
    postings of this 'issue'. I suspect it may exist with 2007 also
    (confirmation?).

    Been asked to look into migration issues from current SW 2004 base into

    SW 2006.

    Several of the designers are complaining that 2006 does not seem to
    have
    the same cutting-along-a-surface abilities of 2004.

    For example, take a surface, Put a bunch of pins through it, then use
    the CUT-Extrude feature to cut off the pins above (or below) the
    surface
    en masse.

    When I looked at the VBS generated by SW, it seems that 2004 is using a

    SelectById call whereas 2006 is using a SelectById2 call. I wonder if
    this has anything to do with the problem.

    At any rate, has anyone experienced this problem? More importantly, is
    there any solution to this? (Am I missing something terribly
    obvious?!?)

    Thanks in advance.
     
    DragonAtWork, Apr 3, 2006
    #1
  2. DragonAtWork

    TOP Guest

    SelectByID2 is just an updated version of the prior SelectById. That is
    nothing to be concerned about. I would like to see an example of the
    problem with cut-extrude.
     
    TOP, Apr 3, 2006
    #2
  3. DragonAtWork

    Heikki Leivo Guest

    For example, take a surface, Put a bunch of pins through it, then use
    I guess you are looking for Insert -> Cut -> With Surface? That has been
    along since I remember, and works still well AFAIK.

    -h-
     
    Heikki Leivo, Apr 4, 2006
    #3
  4. DragonAtWork

    DragonAtWork Guest

    Sorry. I made a mistake. Apparently the function in question does seem
    to work with both versions. My mistake.

    However, when I record a macro to do this, it is unable to do it. That
    is to say, only manually can I cut some particular part of a planar
    extrusion.

    --------snip-------------
    Sub main()

    Set swApp = Application.SldWorks

    ' get the part --prepared with waiting extrusion positioned through
    planar surface
    Set Part = swApp.OpenDoc6("E:\111\Assem1.SLDASM", 2, 0, "", longstatus,
    longwarnings)
    Set Part = swApp.ActivateDoc2("Assem1", False, longstatus)
    swApp.ActiveDoc.ActiveView.FrameLeft = 0
    swApp.ActiveDoc.ActiveView.FrameState = 1
    ' change to shaded view
    Part.ViewDisplayShaded
    'select the extruding part
    boolstatus = Part.Extension.SelectByID2("", "FACE", 0.03690434001857,
    0.02652088599496, -0.03610309674377, False, 0, Nothing, 0)
    Part.EditPart
    Part.ClearSelection2 True
    ' select the planar surface the extruding part extrudes/passes through
    boolstatus = Part.Extension.SelectByID2("HCM145-2@Assem1", "COMPONENT",
    0.04670531419703, 0.0414445816848, -0.001999999999896, True, 0,
    Nothing, 0)
    ' chop part of it off
    Part.InsertCavity4 0, 0, 0, 1, 1, -1
    ' rebuild the project
    boolstatus = Part.EditRebuild3
    Part.ClearSelection2 True
    Part.ViewDisplayShaded
    Part.ShowNamedView2 "*Isometric", 7
    Part.EditAssembly
    End Sub
    --------snip-------------

    Any ideas why SW only seems to work manually in this case?
     
    DragonAtWork, Apr 4, 2006
    #4
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.