Lesson 7.4 – PropertyManager Pages

You need to be logged in to view this content. Please login or become a member.

<<  Prev   |   Index   |   Next  >>


Ever wanted to create macros with SolidWorks-native user interfaces? This lesson will show you how to do just that via PropertyManager pages (PMP). At the end of the lesson we also show you how to create previews using temporary bodies.


Run-time errors in VBA classes are a little quirky. When an object doesn’t get set, you might not get an error at all. Instead, the macro just stops. Or you might get an error on the line of your standard module that calls a procedure within the class, even though the error actually occurred on a line in the class.

If a PMP is open and you need to select one of the following objects, do not use the Select method found within the interface of that object. Instead use IModelDocExtension::SelectByID2, which handles selection correctly regardless of whether the PMP is open.

  • IAnnotation
  • IComponent2
  • IFeature
  • IFeatureManager
  • ISketchHatch
  • ISketchPoint
  • ISketchSegment
  • ISketchSpline

Advanced: It is possible to contain the PMP layout and handling code in the same class. The advantage of this is that you do not need to create Public variables for the resource ID’s in a standard module. For handler argument in ISldWorks::CreatePropertyManagerPage, use “Me” since you are referencing that module.

Lesson Files

Lesson 7.4 code – start
Lesson 7.4 code
Lesson 7.4 – create spike
Code snippets


  1. CryoDesigner

    Hi Keith,

    IPropertyManagerPageSelectionbox::ItemText gets me the text inside the Selection Box but how can I Set the text inside the Selection Box. I have my Section Box to filter dimensions but sometimes I get the generic “Dimension” and other times I get the dimension name such as “D6@Sketch3”. I prefer the latter so I thought I would just programmatically get the name of the dimension but I have to be able to write to the Selection Box. Thanks

    • I don’t think you can set that text value, unfortunately. It would have to be via either a member of IPropertyManagerPageSelectionbox or IPropertyManagerPageControl (which the former inherits from) and neither of those classes contain members that let you do that.

Questions and Comments

You must be logged in to post a comment.