Refresh Drawing Propereties
Refresh Drawing Propereties
(OP)
I have a macro that assists with custom properties. After running the macro on a drawing, the properties are saved but the titleblock does not refresh. For instance, if I open drawing and change the "STATUS" property from "PRELIMINARY" to "RELEASED", my drawing still shows "PRELIMINARY" in the titleblock. If I do a print preview, the preview still shows "PRELIMINARY" and the printed version does too.
As soon as I click rebuild, the property updates. Is there a way to call for a refresh from the API without rebuilding the entire drawing and the views on the drawing? I just want the custom properties to refresh at the end of the macro.
As soon as I click rebuild, the property updates. Is there a way to call for a refresh from the API without rebuilding the entire drawing and the views on the drawing? I just want the custom properties to refresh at the end of the macro.






RE: Refresh Drawing Propereties
Why you wouldn't like to rebuild you model with ModelDoc2::EditRebuild3 method?
Artem Taturevich
CSWP
RE: Refresh Drawing Propereties
The problem I've ran into now is that the code for this current problem is locked. I have contacted the owner of the code to see if he can help address the issue. The original code had an "ini" file to help customize to the individuals needs, but it does not allow edits to the macro (*.swp) file itself. Bummer.
Someone else suggested this as a way to refresh the properties.
CODE
RE: Refresh Drawing Propereties
RE: Refresh Drawing Propereties
When I change the drawing document properties, the linked annotations in the drawing update immediately.
RE: Refresh Drawing Propereties
RE: Refresh Drawing Propereties
CODE
Sub main()
swModelDoc.WindowRedraw
Set swApp = Application.SldWorks
End Sub
And I modified the code several times trying to find something that would work ...
CODE
CODE
CODE
And of course VB would wants to go into debug mode with all of these scenarios because it realizes that I am not a programmer! Any suggestions on how to write a simple macro to refresh the screen? I've tried the recorder, but it only captures certain actions and everything I tried did not record any code that would suggest a rebuild.
Also, in order for this to work, I will need to find a way to write a macro that call macro A then when it finishes calls macro B. Is this possible?
RE: Refresh Drawing Propereties
Chris
SolidWorks 09, CATIA V5
ctopher's home
SolidWorks Legion
RE: Refresh Drawing Propereties
RE: Refresh Drawing Propereties
RE: Refresh Drawing Propereties
CODE
Dim modelDoc2 As modelDoc2
Sub main()
Set swApp = Application.SldWorks
Set modelDoc2 = swApp.ActiveDoc
modelDoc2.EditRebuild3
End Sub
RE: Refresh Drawing Propereties
RE: Refresh Drawing Propereties
That said, thanks to ArtemTat for getting me on the correct path. I did not mean to exclude you from the credits.
RE: Refresh Drawing Propereties
http:
Matt Lorono
CAD Engineer/ECN Analyst
Silicon Valley, CA
Lorono's SolidWorks Resources
Co-moderator of Solidworks Yahoo! Group
and Mechnical.Engineering Yahoo! Group
RE: Refresh Drawing Propereties
I think you should also try to suppress drawing views. This should prevent their rebuilding while EditRebuild3.
Do you have a large drawing which takes a time while ModelDoc2::EditRebuild3? If so could you please try to suppress the views before rebuilding (select the view from the FM Tree and click Hide command. I believe actually it is the suppress command not hide since from the API it is called SuppressView).
Please note how long time it takes. If the time for rebuild is reduced I can help you to write a macro which will suppress/unsuppress all drawing view within the document.
Artem Taturevich
CSWP