Selecting the Path objects on multiple Area Types - adobe-illustrator

I have about 60 "text boxes" (area type objects) and would like to simultaneously adjust their background colors.
This can be done manually by using the Direct Select tool, and shift-clicking the edges of several Area Type objects, then adjusting their fill property.
This workflow is tedious, however, because I can't group these path objects - and thus a single mis-click means I need to redo a lot of meticulous shift-clicking. Is there a way to explicity select all of these path objects? Selection -> Object -> same type selects the Area Texts, not their nested path object.
Grumble, thanks for any insight.

Select all Area Type objects, move them to a new Layer, make other layers invisible and then select all the shapes by the Direct Select tool with no shift

I figured it out.. very unintuitive. Here's how:
Select > Object > All Area Type Objects
Object > Expand Appearance (this was the key step)
Now the Area Types and their background shapes were 'separated'. Next:
Select > Object > All Area Type Objects
Select > Inverse
And now I had all of the shape objects selected, without their Area Types.
I was able to save this selection (via Select > Save Selection), and upon re-choosing this saved selection, only the shapes were selected, not their Area Types.

Related

Setting shape position to book layout in vba

I want to use a word macro to set the position of the shapes in the document to book layout (see screenshot). But I can't find any reference which member I need to set for this (probably because my word is in german and this is called differently in the macro).
Can anyone tell me how to set the horizontal layout of a shape to book layout in vba?
[update] The following did the trick:
Shape.Left = -999994
Shape.LeftRelative = -999999
Shape.RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
In the most recent versions of Word the macro recorder gives no help for graphical objects. The next best thing you can do is to look at the properties available for the object in the Object Browser (F2).
If a graphical object has "text wrap" formatting then it belongs to the Shapes collection, so the list you need to look up is that of the Shape object.
In there you'll find the property RelativeHorizontalPosition, which takes a member of the WdRelativeHorizontalPosition enumeration. Looking at that list there are a number of options, none of which has "book" in it.
So the next step is to insert and format a Shape with the desired positioning. Then in the Immediate Window (Ctrl+G) you can type:
?ActiveDocument.Shapes(1).RelativeHorizontalPosition
Then press Enter. This will print a number that corresponds to the list of Enumeration members.
You can also test the effect of the various members by assigning them in the Immediate Window:
ActiveDocument.Shapes(1).RelativeHorizontalPosition = wdRelativeHorizontalPositionOuterMarginArea
Press Enter.
What you'll see is that there is not an enumeration member for every option in the dialog box. And that various positioning options in the dialog box correspond to a single enumeration member.
For your specific question, wdRelativeHorizontalPositionInnerMarginArea corresponds to the dialog box option you indicate.
ActiveDocument.Shapes(1).RelativeHorizontalPosition = wdRelativeHorizontalPositionInnerMarginArea
Besides the above, you need to use the LeftRelative and Left properties, as well. Take a look at those settings in the Immediate Window after using the dialog box and play with them, putting the image on odd/even pages.If it disappears - it's off visible portion of the page, which you can see in Reading View. In a nutshell, you need the NEGATIVE numbers to lock the image to the margin or page side. Positive numbers position it absolutely.

Labview : Changing color of boolean array, respectively

I made this boolean array.
I want change the color of first boolean component as red, and second as blue.
This picture is what I want.
But when I change color property, three booleans change their color with together.
Is there any way to change color of boolean components, respectively?
Short answer: Just replace the boolean with a color box, as shown in the links in the other reply. It will simply be an array of color boxes instead of an array of booleans.
Long answer: An Array control contains an inner element control. The only property that can differ between elements of the array is the Value property. All other properties are rendered identically across elements of the array. If you need to differentiate the elements based on something other than the Value, you need to either use a different control that renders the graphical aspect that you want as its Value (i.e. replacing the Boolean with a Color Box) or you need to break out the N elements that you want to display as N separate independent controls and manage the updating of the display by yourself through code on the block diagram. This generally means creating your own scrollbar control or numeric control for controlling the index of the array.
You can always try to change your approach a little, try using clusters and if you need to use array, then create array of clusters. Here and here are similar subjects that should help you solving the problem with colors.

Labview change properties of control by code

How could I change max and min values in control "fill slide" by code?
Here is my program and it should take max and min values from CSV file and change scale range in fill slide's properties. How could i get access to fill slide's properties?
https://drive.google.com/file/d/0B7eFfQuRzPgASHQtNTY0LVpmY0k/view?usp=sharing
In the diagram, right click on the control and create a property node. Select the Data Entry Limits property, min and max can be set. The property node must be writable to set properties.
after creating property node, right click on it, choose Properties, Scale, Range, and Minimum (or Maximum) to set the visible data range for the fill slide. Let me know if you need more help.

Is it possible to colour a cell with value from data in Cognos BI?

Let me first be clear. I'm not asking about how I do conditional formatting in Cognos BI. If there were a simple Red/Amber/Green colour scheme, based upon value ranges then I could do that. If it were a static list of colours, which never changed, I could also do that.
What I am after is accessing a hex colour code that is stored in my database, and I want to use that colour as my table cell background colour. This is something I commonly do in SSRS reports, but cannot see a method for in Cognos BI.
Is this even possible?
You can do this via the HTML object in Cognos.
The HTML object can get its definition from one of the three main ways:
1) Hard-coded text
2) Data Item Value
3) Report Expression
Obviously the first method provides no way to dynamically set the value. I couldn't get the second one to work at all. I'm not yet sure why. However, I was able to use the third type to work to allow dynamic setting of a visual style.
For the solution we'll assume you have a data item called [Color] which pulls a string value from a database in the standard hex form that is used in CSS: #xxxxxx, e.g. #CCCCCC. For the purpose of this example we'll assume it is in query Query1. The following steps describe how to set it up.
1) Add an HTML item right above your list
2) Add another HTML item at the bottom of your list
3) In the top HTML item add a span tag with a unique id such as:
<span id="list">
4) In the bottom HTML item add a closing span tag
</span>
5) Add a third HTML item before all of the other HTML items
6) Set the 'Source Type' property of the HTML item to 'Report Expression'
7) In the Report Expression put the following code:
'<style>
#list td {
background-color: ' + [Query1].[Color] + '
}
</style>'
8) Select the Page object and set the Query property to Query1
9) Click on the Properties property. Check the Color column to give the page access to that query-sourced value.
Now you can dynamically set the column color based on a database provided value. We used the span to give us a way to isolate just the table cells we want to manipulate.
The technique isn't perfect. For instance, the header cells also get their background changed to the color in question, which may or may not be desirable. This is because Cognos doesn't use the th tag for headers but instead renders them as normal cells (td).
I know it's quite and old post but just for completeness I'll add the references to get this working in html, pdf and excel.
To get this working not only for html but also for pdf and excel use a rich text item instead of a html item.
You can use following code in a query item for instance:
<span style="display:block; background-color:' + [Query Subject].[Query Item] + '"> </span>
The query item must then contain a valid color (e.g. rgb(255,0,0)) etc. which is defined by your data source.
Dragging a rich text item in a list and changing it to data item value and selecting the query item will work.
By using the span it will work for excel too, however to make sure it follows the size of the upper object in the hierarchy (the list column or a table etc) you want the display:block style.
Instead of the space in between the > < you can use any other query item that you want to appear as text.

Excel Indirect() type function For VB.net?

In excel I could say =INDIRECT("A" & G3) where G3 had a value of 4 and my cell would then refer to A4. What I am looking for is a similar kind of function for VB.net.
Is there a way to refer to a different variable based on a variable. EG. first pass I was to refer to txtJobNum1, txtBatNum1, and lblBat1. on pass two txtJobNum2, txtBatNum2, and lblBat2. If it were only a few, 3-4 maybe, it wouldnt be bothersome, but it's 50. The best I have come up with now to work around is build a class that holds references to those objects and make an array of that class. Below is an example table showing What I want to make with a given input number.
You can see how if I could make use of an "INDIRECT" function It could potentially shrink down to a 5-6 line loop instead of 200 lines of just variable assignments.
my concept of how it would work
BatchGroups(<NUMBER>).Label = lblBatNum<NUMBER+1>
0 BatchGroups(0).Label = lblBatNum1
0 BatchGroups(0).Number = txtBatNum1
0 BatchGroups(0).Quantity = txtQtybat1
0 BatchGroups(0).JobNumber = txtJobNum1
1 BatchGroups(1).Label = lblBatNum2
1 BatchGroups(1).Number = txtBatNum2
1 BatchGroups(1).Quantity = txtQtybat2
1 BatchGroups(1).JobNumber = txtJobNum2
2 BatchGroups(2).Label = lblBatNum3
2 BatchGroups(2).Number = txtBatNum3
All of the controls are stored in the Controls collection of their parent, and the controls in the Controls collection are addressable by name, like this:
Dim theControl As Control = Me.Controls("txtJobNum" & theNumber)
(Where Me is the Form) If the controls are in some other container control, such as a panel, you can get to them through that container control's Controls property, for instance:
Dim theControl As Control = MyPanel.Controls("txtJobNum" & theNumber)
However, having 50 some-odd controls like that sounds like it may be a bad design anyway. It may be better to consider having a grid, or an editable list of some sort. If you must have all of the separate controls like that, it would probably be better to dynamically load them in a loop, and then store references to them in a list of BatchGroup objects as you were thinking. It would be much easier to to that in a loop because you'd only write the code once rather than separately for each batch group.
More generally, the term in .NET for what you are asking is called "Reflection". However, using reflection can cause your code to be more brittle and it is also not very efficient, so, when there are other alternatives, is is the case here, it is usually best to take one of them, rather than resorting to reflection.
Create a dictionary of your objects by Name. Then use TryGetValue to retrieve. In this case it would expect a String value as a Key, so you can have a custom naming scheme, which maps 1-to-1 onto your controls list.
Read more about a Dictionary class on MSDN:
Dictionary(Of TKey, TValue) Class
You could use .Controls of the parent container, but then your controls could be nested in each other, so you'd have to use recursion or linearize into flat list, either adds complexity and maintainbility effort, and reduces performance. Dictionary is the fastest, especially if your Key is a string.