Modifying base part dimenions

I have an assembly, with a part inserted which is actually a part, with an inserted part (base part).  I can't seem to access the sketch dimensions in the base part from the assembly.

Here's the "structure":

MasterAssembly.sldasm

  DerivedPart.sldprt

   BasePart.sldprt

I've tried BasePart@DerivedPart-1, DerivedPart-1@BasePart, DerivedPart-1/BasePart, BasePart/DerivedPart-1 and so far, SolidWorks throws the following error:

"GetParentComponentByNameTree Error: Component not found for name '' in component path"

Can anyone tell me how to access sketch/feature dimensions in the BasePart?  This is my first time working with a part made by inserting another part - I'm stumped.

Thanks

SolidworksApi macros
Answers 5
DG
DG 2017-08-15 Best Answer

Try

<strong>Part.Extension.SelectByID2 "dimension name@sketch name-base part name@derived part name with instance@assy name", "DIMENSION", 0, 0, 0, False, 0, Nothing, 0 </strong>

e.g.

<strong>Part.Extension.SelectByID2 "D1@Sketch1-BASE@DERIVED-1@Assy", "DIMENSION", 0, 0, 0, False, 0, Nothing, 0 </strong>
TC
TC 2017-08-15

Okay - that got me there, but the dimension value isn't changing.  I'm guessing I need to drill down into my base part and change that value so instead of D1@Sketch1-BasePart, it should be Depth@Sketch1.  Maybe this isn't possible?

TC
TC 2017-08-15

I should add - the sketch did change - but the geometry didn't.  But when I try that same approach to an extrusion dimension - nothing happens....

DG
DG 2017-08-15

The base part dimensions are derived dimensions and can not be changed from the derived part or assembly. So you need to open the base part and then modify it's dimensions.

TC
TC 2017-08-15

Thanks Deepak - that did the trick!