Page 1 of 1
garbage in render settings text field is getting tiresome...
Posted: Tue Aug 07, 2007 1:55 am
by b-kandor
Under what circumstances programming wise could the following repetitively appear in the command line field of the sw2007 mr pluging render settings?
"WPñºÐkË@SÔkË@ªò´%škË@À,…˜~kË@:±§äbkË@ž±jGkË@·!+kË@ö$kË@ü¡ÐèòjË@ý>„´ÖjË@—ô¡sºjË@úÞ*žjË@a`ÝjË@&rf‘ejË@ÉõJIjË@î<-jË@‚G!ÜjË@!;0¾ôiË@¾ŽÇ¶ØiË@ÏoBʼiË@öÝ÷ü iË@Yþ9S…iË@¼oUÑiiË@hŸ{NiË@+V3iË@ü\eiË@øVýhË@—}=2ãhË@iÅ0øÈhË@õgC¯hË@™ ~W•hË@
LÞø{hË@ IUëbhË@dÞÇ2JhË@9š
Ó1hË@ó>ðÏhË@§)+-hË@+¾jîêgË@öÔKÔgË@W+[«½gË@GÖ®§gË@¾·ã"’gË@¸ö
}gË@"
Arn't option fields set either from the registry or an .ini file or hardcoded values within the application?
Posted: Thu Aug 09, 2007 7:28 am
by purCAB
While I may not have put this as succinctly as b-kandor, I have to agree. Especially so, given the length of the "garbage" that needs to be cleaned up and the fact that this bug is 100% repeatable by 100% of the SolidWorks users...although if this was a SolidWorks problem, then they would say, no doubt, that it's an enhancement request and not a bug.
Ken
Can a VBA macro clear it?
Posted: Fri Nov 02, 2007 11:56 pm
by br54
On page 17 of the .pdf doc for the Rhino-Maxwell plugin it says "All parameters in this panel are accessible to RhinoScript through the command
'Maxwell_OutputSettings'."
So in the Rhino world, a user could quickly create a VBScript (RhinoScript) workaround for a situation like this, making things less tiresome.
SolidWorks is scriptable in VBA, but is the SolidWorks-Maxwell plugin equally as accessible to VBA as the Rhino-Maxwell plugin is to RhinoScript?
The scriptability of the Rhino-Maxwell plugin is excellent!
Posted: Sat Nov 03, 2007 6:47 pm
by JDHill
VBA, eh? Will this work?
a quick form:
a little code:
Code: Select allOption Explicit
Private Sub UserForm_Initialize()
Dim obj As New Maxwell_Script.ScriptObject
If Not IsNull(obj) Then
obj.Environment.SunEnabled = True
obj.Environment.EnvironmentType = "PhysicalSky"
End If
End Sub
Private Sub btnRenderTimeStudy_Click()
Dim obj As New Maxwell_Script.ScriptObject
If Not IsNull(obj) Then
Dim frameLength, endTime As Double
frameLength = tbMinPerFrame.Text / 60
endTime = tbEnd.Text
obj.DateAndTime.TimeOfDay = tbStart.Text
obj.Rendering.BeginAnimation
Do While obj.DateAndTime.TimeOfDay < endTime
obj.DateAndTime.TimeOfDay = obj.DateAndTime.TimeOfDay + frameLength
obj.Rendering.RenderToMxs
Loop
obj.Rendering.EndAnimation
End If
End Sub
result:

Nice animation!
Posted: Sun Nov 11, 2007 6:04 am
by br54
Good one JD
I'm new to CG, but have coded VBA since it began in Excel 5 back in 1993 (92?). Very useful stuff.
I don't have a SolidWorks install to use to finish developing this for b-kandor and purCAB, but I think they're looking for a quick way to slap a button on a toolbar and associate code like this with the button:
Private Sub btnClearOutputObjectGarbageText_Click()
Dim obj As New Maxwell_Script.ScriptObject
If Not IsNull(obj) Then
obj.OutputObject.Text = ""
' obj.Refresh
End If
End Sub
Like I say, I don't have a SolidWorks install to finish this with, so maybe .Text isn't the field on .OutputObject that needs to be cleared. And I don't know what if anything is needed in the way of a refresh to get the plugin UI to update fields that have recently been changed by a VBA script. But from the looks of that screenshot I bet it won't take much to massage the above 6 or 8 lines of code into a useful workaround.
Posted: Sun Nov 11, 2007 12:55 pm
by JDHill
You got the idea. I maybe should've clarified that this will be part of the new SW plugin, which is not released yet.
The script object has the same object/property layout as the Scene Manager UI, which is the same one used in the Rhino plugin. The plugin is always listening for changes made by script, so no refresh is necessary. So the code to change the command line is the same as if you were to do it physically, using the UI:
Dim Maxwell as New Maxwell_Script.ScriptObject
Maxwell.Output.CommandLine = ""
The result of this would be shown in the Scene Manager UI as soon as it was executed. But this particular routine is unnecessary, since the new plugin won't have the junk-text issue in the first place. Also, the script library is completely separate from the SW plugin - the same code will work in SW or Rhino, where this will pretty much remove the need for most of the 'Maxwell_DoSomething' plugin commands.
Technically speaking, this is a .Net class library, which exposes an explicit interface to COM, so it can be used in basically any coding environment...either late-bound using CreateObject(), or early-bound by adding a reference to the library and using New. So apart from VBA, it's fine to use it in script, or directly from another plugin.
Now, back to work...cheers!
JD