Hello All
I tried to use following code from API help manual
I want to cpature event such as when user select block in drawing environment then the Property page manager dialog comes on screen
I want close this page automatically when user selects
this page has onclose button - when this button is clicked page closes
Dim swModel As SldWorks.ModelDoc2
Dim DialogId As Integer
Dim Title As String
Dim Handler As Object
Dim value As PropertyManagerPage
Set swApp = GetObject("", "SldWorks.Application")
Set swModel = swApp.ActiveDoc
value = swModel.GetPropertyManagerPage(DialogId, Title, Handler)
value.Close
I get following error as
Object variable or with block variable not set
Kindly suggest the solution for the same
- Sanjay
SolidworksApi macros
This is the obsolete method to create a property page. You have this exception because ‘handler’ parameter is nothing. You need to use SldWorks::GetRunningCommandInfo method for your needs which will return the currently opened Property Manager Page. You can also capture the DSldWorksEvents_CommandOpenPreNotifyEventHandler to handle the moment when the property page is opened.
Thanks a lot Artem,
It really helped me very much
Only change I have done is that I have used swApp_OnIdleNotify() event
along with swApp_CommandOpenPreNotify event
Thanks again & have great new year
- Sanjay