I wrote a macro that saves an image from CATIA, using the CaptureToFile method in the Viewer object. The macro works great, but only when the Render Style is "Parallel". Some of the designers in my company do not have the Render Style to "Parallel", so I want to change the Render Style to "Parallel" with the macro.
There is a property in the TreeTabSettingAtt object, called RenderStyle. The documentation says that the property "Returns or sets the value to signify
whether the 3D Render Style is Parallel or Perspective". It seems to be exactly what I need. To get to that property, I need to get to the TreeTabSettingAtt object, which seems to be a SettingController in the SettingControllers collection, but I can't get to it because I don't know its object type. The latter is needed to be passed as an argument of the Item method of the setting controller collection object. Unfortunately, the Item method only takes a string, which I don't know.
sub CATMain()
Dim catia as INFITF.Application
Dim att as PROCESSITF.TreeTabSettingAtt
Set catia = GetObject(, "catia.Application")
Set att = catia.SettingControllers.Item("I dont know the object type of
TreeTabSettingAtt")
att.RenderStyle "Parallel"
End Sub
In the documentation, seen in the following link, the setting controller object type of many setting controller objects are listed, but some are missing including the object type for the TreeTabSettingAtt setting controller object.
https://www.maruf.ca/files/caadoc/CAAScdInfTechArticles/CAAInfTabPageList.htm
The property you've located seems bound to the application settings (i.e. the ones you change from Tools>Options..). I don't know how good they are exposed to automation but from a quick debug session, it was evident that with
Set att = CATIA.SettingControllers
one actually gets the collection, Count property is 70 in my case, but no Item method was available! This is inconsistent with the documentation. Note that the documentation reports that the argument must be an index in long format, but passed as a string.
Answer:
I have instead located the "live setting" which is bound to the Viewpoint3D object as follows. Note that either in CATScript or CATVBA you don't need to assign the Application object (CATIA object of class Application is always available):
Set view = CATIA.ActiveWindow.ActiveViewer.Viewpoint3D
view.ProjectionMode = catProjectionCylindric
'or
view.ProjectionMode = catProjectionConic
Related
When we work with controls in VBA. (For simplicity, let sht represent a worksheet object)
We normally do sht.Shapes(xxx) or sht.OLEObjects(xxx) to access controls. Shapes() and OLEObjects() are well defined in the documentation. They are properties of the worksheet object.
However, sht.Buttons(xxx), sht.CheckBoxes(xxx) actually also work. But they are not defined in the document. If you check the object library in the VBE, you still can't find them. And if you type things in VBE, no IntelliSense for .Buttons of .CheckBoxes, but there're IntelliSense for .Shapes()
Even though you can access a button using sht.Buttons() and sht.Shapes(), however, I find sht.Buttons() return an object with a much cleaner interface.
So where are the .Buttons method from? Is it just an extension method defined somewhere for the worksheet object?
I'm currently building a custom control to be used as an application's view navigator (classic OneUI style). First of all: this is a 8.5.3 based project, and unfortunately there's no way to use Extlib stuff or other extensions / plug-ins. So we have to build all the tricky stuff ourselves using only what came "out-of-the-box" with 8.5.3.
I'd llike to build my navigator using a repeat control containing <xp:link> controls. Datasource could be an array of javascript objects where each single object would look like this:
var navEntry = {"entryLabel" : "label-of-link",
"entryTarget" : "target-url-of-link",
"entryStyle" : "style-to-emphasize-selected-link"}
Each array element then would describe a single navigator entry.
Since the navigator will be used in all possible "DominoView" Xpages it yould make sense to build the array of JS objects at the Xpage level and then pass that info into the custom control.
I'm aware that there are multiple ways to do this, and one could be "Custom Control Properties". If there was a way to pass my JS object array.
(Hope I could make clear what I'm trying to do here...)
That object looks like a HashMap to me really. You should be able to pass that in to a custom control via custom property if you use the type java.util.HashMap I'd think. You'll need to type it in I'm sure. I've passed custom objects in by using java.lang.Object.
The custom control will get loaded during the Page Load event, and usually properties have to be available at that point. If they're loaded during the Render Response phase, that's too late. So your SSJS object will need to be Compute on Page Load.
To use contents of a repeat control, you would need to set repeatControls=true, otherwise the repeat is only built during render response. Until then it's just a single set of controls with no data in them. However, Im pretty sure repeatControls="true" means you only get the number of rows you define. You can't change it via a pager.
You can manually define the type of the custom property. For a standard SSJS Object you use "com.ibm.jscript.std.ObjectObject", for a SSJS Array you use "com.ibm.jscript.std.ArrayObject" etc. As editor for the custom property, I set the string editor ("String value").
I just can't believe how hard this is.
I would like to edit the content of a Control with Type text. I'm working with lightswitch visual studio 2012. I would like to change this in the screencode (so programmatic).
I gave the control the name: "Message".
Right now, I'm trying this.FindControl("Message")., but there doesn't seem to be any property I can call to set the content. Nether can I cast the control to the correct Type text. Even Text doesn't seem to be a valid className.
Any Help on how to set the content of this control?
EDIT: Should I shoot the ControlAvailable event and try to modify content there?
You're on the right track with this.FindControl("Message"). The way to set a property on it once you have found it is as follows:
this.FindControl("Message").SetProperty("propertyToSet", [new value])
Actually, trying to set the value of a control on a screen is the wrong way to do it.
In LightSwitch, every control is bound to a property (usually an entity's property, but might also be a screen property), so setting the value of that property will update the control.
So if you have a detail screen that is bound to an entity (let's call it ClientProperty), & you have a TextBox control (let's call it MessageControl) bound to ClientProperty's Message property, all your code needs to do to change the value is:
Me.ClientProperty.Message = "This is a message"
If instead, you had a TextBox control (again, let's call it MessageControl) that's bound to a screen property (called Message), your code is as simple as:
Me.Message = "This is another message"
It seems "hard" the way you're trying to do it because it's not meant to be done that way.
I cannot figure out what the deal is with this code. "command" = Park, and the Park method exists in the interface. "method", however, just equals null, so it throws an exception when I hit invoke. The debugger kicks in, and so I was able to make sure that everything looks OK. Why does method not get set?
The scope object is defined. It is a com object. I expanded the dynamic view of the scope object and all it shows is properties or something (blue 3d boxes, not hand and paper), no methods. Is that the problem? But why, since I am referring to ITelescope and don't do anything with scope until I try to invoke the method, which was not set.
I got the Activator code from this question.
ITelescope scope = (ITelescope)Activator.CreateInstance(Type.GetTypeFromProgID(scopeProgID));
var method = typeof(ITelescope).GetMethod(command);
method.Invoke( scope, new object[0]{ } );
I remembered that I had asked another question about interfaces and reflection. The problem has something to do with interop types. To fix it you right click on the offending reference in the reference list of the project, click properties, and set "embed interop types" to false.
I have added a ComboBox to my CHTMLEditCtrl by passing it in a HTML string.
Then dynamically I add the members(items) to it using IHTMLSelectElement.
Now I want to change the font of one of the items that I have just added.
But when I use item() method on this object, it returns a null. Also when I use get_size on the Object, it returns 0, even though all the items I added in the combobox are visible(and hence I infer all the items are added).
I am not able either to retrieve it using COM methods. Any idea?
Usually the DOM elements are available once the page render is complete.