Martin Crawford Posted March 17, 2021 Share Posted March 17, 2021 I have a strange thing occurring. I have several custom objects that I use and I am having an issue with the reset code on one of them. Here is a list of custom objects Panel Specification Create Panel Create Data Create Circuit Create Display All four of the Create objects refer back to the Panel Specification. In side of Panel Specification I have code to reset the four Create objects, so if any of the Specifications change, all related objects are update. This all works quite nicely. The strange thing that is occurring, is after Panel Specification runs and all the updates are done, I am unable to select the Create Display object. I can select all the others, just not Create Display. The only way I can get it selectable again is by using the Custom Selection tool, then make a change to one of the Create Display parameters. Does this make sense, and is there a workaround? Here is the code for doing the reset. It works, except for not being able to select the Create Display object when all done. #***************************************************** def RefreshPanels(PanelSpecificationID,UUID): #***************************************************** def RefreshPanelsDetails(h): vs.ResetObject(h) pass searchCriteria = "(INOBJECT & INVIEWPORT & (PON='Create Panel') & ('Create Panel'.'PanelSpecificationID'='" + PanelSpecificationID + "'))" vs.ForEachObject( RefreshPanelsDetails, searchCriteria ) searchCriteria = "(INOBJECT & INVIEWPORT & (PON='Create Display') & ('Create Display'.'PanelSpecificationID'='" + PanelSpecificationID + "'))" vs.ForEachObject( RefreshPanelsDetails, searchCriteria ) searchCriteria = ("((PON='Create Circuit') & ('Create Circuit'.'UniqueID'='" + UUID + "'))") vs.ForEachObject( RefreshPanelsDetails, searchCriteria ) searchCriteria = ("((PON='Create Circuit') & ('Create Data'.'UniqueID'='" + UUID + "'))") vs.ForEachObject( RefreshPanelsDetails, searchCriteria ) pass Quote Link to comment
JBenghiat Posted March 17, 2021 Share Posted March 17, 2021 Where/how are you calling RefreshPanels()? Is the specification object still creating geometry? As a side note, vs.ResetObject() already is a function that takes a handle as a parameter, you you can pass it directly to ForEachObject() Quote Link to comment
Pat Stanford Posted March 17, 2021 Share Posted March 17, 2021 Your quotes and parentheses are also different in the different cases. Some have the quotes on the outside, others have the parens on the outside. Since searchcriteria must be a string, are you possibly not getting the criteria you think in some cases? Quote Link to comment
Martin Crawford Posted March 17, 2021 Author Share Posted March 17, 2021 I am running the refresh as the very last line of code. RefreshPanels(panelSpecificationID,UUID) Both panelSpecification and the UUID are parameters to the Create Specifications. Nice tip on passing to ForEachObject, it makes sense, just never thought about it. Quote Link to comment
Martin Crawford Posted March 17, 2021 Author Share Posted March 17, 2021 @ Pat I will check the strings and make sure they are good, however I do know the routine is being triggered as it will visible update the screen. The real challenge is after the reset, I can no longer select the Create Display object. I did discover that if I select a different class, turn the Panel class off, then back on, the reselect the Panel class, then I can select the Create Display. Quote Link to comment
Pat Stanford Posted March 18, 2021 Share Posted March 18, 2021 Have you tried adding a Redraw or RedrawAll? Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.