Get selected art object

I am trying to get the user selected art object properties, I tried written the code below and realised this get all the objects in the layer and store all of them in the AIArtHandle instead of what I selected. I only want to print out the one user selected, how??? any help???
AIMatchingArtSuite *aiArtMatch;
sBasic->AcquireSuite( kAIMatchingArtSuite, kAIMatchingArtSuiteVersion, (const void**)&aiArtMatch );
AIArtHandle **artStore = NULL;
long artCount = 0;
aiArtMatch->GetSelectedArt(&artStore, &artCount);
AIArtHandle my_artHandle = (*artStore)[0];

I believe the problem you're having is that selection 'climbs upwards'. That is, if you select some art you also select it's parent, and its parent's parent, etc.
So even if you just select a single path, you're also selecting the group that represents the layer. As such, you might be able to just ask the art if it's a layer group using AIArtSuite::IsArtLayerGroup() and ignore it if it is. I believe the rest will be an accurate depiction of what's selected, be it on art or many.
Oh, and if the art you've selected is a compound path, that call will also include all the sub-component paths. If you don't want them, you can also ask each art in your set if it's part of a compound path by using AIArtSuite::GetArtUserAttr() with kArtPartOfCompound; I believe you can ignore anything that has that, though I'm not sure how it responds when you pass it the container kCompoundPathArt.
Hope that helps!

Similar Messages

  • JTree get selected node/object values

    I wan to get all the selected nodes/objects values that I added to the JTree. How can I do this?
    Thanks.

    TreePath[] paths = tree.getSelectedPath();
    for(int i = 0; i < paths.length; i++){
    TreeNode node = (TreeNode)paths.getLastPathComponent();
    Object mySelectedObject = node.getUserObject();
    }Some minor Errors
    We have to use array paths[i] instead of paths
    The correct code as used by me is
            javax.swing.tree.TreePath[] paths = jTree1.getSelectionModel().getSelectionPaths();
            for(int i = 0; i < paths.length; i++){
                javax.swing.tree.TreeNode node = (javax.swing.tree.TreeNode)paths.getLastPathComponent();
    System.out.println(((javax.swing.tree.DefaultMutableTreeNode)node).getUserObject());
    CSJakharia

  • Unable to select 'Art Text' object.

    Hi,
    Not sure whether this happens only to me. I just added one image (jpg) through Insert -> File options changed it opacity, then I selected the art text tool for adding some text.
    But after adding the art text and when I tried to select the text, Instead of selecting the art text, I was only able to select the background jpg.
    Can anyone shed some light here?.

    Hello,
    It would be beneficial for the development team to take a look at the file.
    When the text is above the image it should work as  expected. When it is behind, the image  will be selected. You can always select "blocked" objects with help of  the "Objects" Panel on the left.
    Thanks,
    Sarah
    Sarah
    Forum Moderator

  • Get notified when art object is deleted or added

    Hi, anyone know how to get notified when user added or deleted an art object?
    I searched the SDK in and out and found nothing.
    Thanks,
    Don

    If you have art you wish to keep track of, the way to do it is using ArtUIDRefs (AIUID.h). You can ask art for a unique identifier and later on ask for the handle that belongs to that UID. Its not too hard at that point to determine if it still exists or not. Note that you will probably need to use AIArtSuite::ValidArt() if you get a handle back. This tells you if the handle is actually on the canvas or not; handles persist even when deleted becuase the delete could be undone.
    So if you're tracking a small number of particular handles, its quite easy to know whent hey're deleted. If you're trying to watch a huge number of art handles though, you're going to pay a heavy price. While I wish they had better ways to deal with this, the truth is the SDK isn't designed for that kind of plugin. You can make it work, but you're kind of out on the edge of what they'd planned.

  • How to properly create path art object, please help

    Hello there,
    I have a vector of AIRealPoint , each point is actual X, Y coordinate of the stroke. I need to create path art object out of this vector.
    I'm  somehow confused how to correctly construct segments array form the given AIRealPoints, my goal is to have single path object where count of segments is equal to count of AIrealPoints first and last points are anchors. SDK documenation is not really helping here...
    Please, take a look at the code snippet, it seems I'm doing something wrong with in and out params of segment , in any case I fail to create simple path object ....
    ASErr CretaeVectorPathTest2(vector<AIRealPoint>& stroke)
    AIArtHandle artHandle;
    ASErr result = kNoErr;
    try {
      AIRealPoint start;
      long lngStrokeLength = stroke.size()-1;
      AIArtHandle lineHandle = NULL;
      AIErr error = sAIArt->NewArt( kPathArt, kPlaceAboveAll, NULL, &lineHandle );
      if ( error ) throw( error );
      error = sAIPath->SetPathSegmentCount( lineHandle, lngStrokeLength );
      if ( error ) throw( error );
      AIPathSegment *segment = new AIPathSegment[lngStrokeLength];
      // This is a first point of the path
      segment[0].p.h = stroke[0].h;
      segment[0].p.v = stroke[0].v;
      segment[0].in = segment[0].out = segment[0].p;
      segment[0].corner = true;
      for(inti=1 ;i< lngStrokeLength-1;i++)
       segment[i].p.h = stroke[i].h ;
       segment[i].p.v = stroke[i].h ;
       // NOT GOOD!!!
       segment[i].in.h  = stroke[i-1].h ;
       segment[i].in.v  = stroke[i-1].v ;
       segment[i].out.h  = stroke[i+1].h;
       segment[i].out.v  = stroke[i+1].v;
       segment[i].corner = false;
    // NOT GOOD!!!
      // This is a last point of the path
      segment[lngStrokeLength].p.h = stroke[lngStrokeLength].h;
      segment[lngStrokeLength].p.v = stroke[lngStrokeLength].v;
      segment[lngStrokeLength].in = segment[lngStrokeLength].out = segment[lngStrokeLength].p;
      segment[lngStrokeLength].corner = true;
      error = sAIPath->SetPathSegments( lineHandle, 0, lngStrokeLength, segment );
      if ( error ) throw( error );
      error = sAIPath->SetPathClosed( lineHandle, false );
      if ( error ) throw( error );
    // apply color width etc.
      AIPathStyle style;
      error = sAIPathStyle->GetPathStyle( lineHandle, &style );
      if ( error ) throw( error );
      style.strokePaint = true;
      style.stroke.color.kind = kFourColor;
      style.stroke.color.c.f.cyan = 0;
      style.stroke.color.c.f.magenta = 0;
      style.stroke.color.c.f.yellow = 0;
      style.stroke.color.c.f.black = 100;
      style.stroke.width = 0.75;
      style.stroke.dash.length = 0;
      delete[] segment;
      error = sAIPathStyle->SetPathStyle( lineHandle, &style );
      if ( error ) throw( error );
    catch (ai::Error& ex) {
      result = ex;
    return result;
    Thanks,
    David

    As for beziers, Illustrator uses cubic beziers which are fairly straight forward (thank goodness!). Here's a lift from Wikipedia's Bezier entry:
    This image is pretty good at demonstrating how AI's bezier segments work. In the animation, the moving point has two lines sticking off it, ending with two points. If P3 was an AISegment, the left-hand blue point would be in and the right-hand point would be out. If we were to translate the state of the animation in its last frame into AI code, you'd basically have something like this:
    AISegment segment1, segment2;
    segment1.p = p0;
    segment1.in = p0;
    segment1.out = p1;
    segment2.in = p2;
    segment2.p = p3;
    segment.out = p3;
    Note that this would imply any line that continues beyond either end point isn't a smooth beizer curve (i.e. the curve is limited to between these points). That effectively makes them corner points (I think). Also, the line formed by linking in & p or out & p is the tangent to the curve at p, which I think you can make out from from the animation.
    Another way to get a feel for this is to use the pen tool to draw a line with a few segments. If you then pick the sub-select tool (white selection arrow, not black selection arrow) and select individual points on the curve, you'll see when you do that two 'anchors' jut out from each point. Those are the in & out for that point on the curve.
    Its all a little confusing because technically, a bezier segment between p & q would be p, p.out, q.in & q. (four vertices). To avoid repeating information, and keep it simple for non-beziers, AI's segments are still the vertices. So if you wanted to make the nth segment a beizer, you'd need n & n+1 from AI's path, and you'd modify two-thirds of each AISegment (p, out from n & in, p from n+1).
    I hope that helps, but if you have any further questions, feel free to ask! If you need to do anything fancy with beziers, there are some helpful utilites in AIRealBezier.h.

  • Dvt:pivotFilterBar - how to get selected values from filter

    Hi all,
    I have a question: how to programmatically get selected values from pivot table's filter bar?
    I have tried to use
    pivotTable.getDataModel().getDataAccess().getValueQDR(startRow, startCol, DataAccess.QDR_WITH_PAGE);but for page edge dimensions it returns BAD DATA, it seems that it returns some cached values.
    Environment: JDev 11.1.1.3.0 without any patches.
    thanks,
    Miroslaw

    Hi,
    You can retrieve the selected value in the PivotFilterBar through the model of PivotFilterBar, instead of dataaccess:
    // get the model from the pivot filter bar instance
    QueryDescriptior queryDescriptor = (QueryDescriptor)pivotFilterBar.getValue();
    // retrieve a list of criterion, each one is used to populate each lov within the pivot filter bar
    ConjunctionCriterion conjunctionCriterion = queryDescriptor.getConjunctionCriterion();
    List<Criterion> criterionList = conjunctionCriterion.getCriterionList();
    for (int i=0; i<_criterionList.size(); i++) {
    AttributeCriterion criterion = (AttributeCriterion)criterionList.get(i);
    // _selected is the currently selected value
    Object selected = criterion.getValues().get(0);
    System.out.println(_selected);
    Hope that helps,
    Chadwick

  • How to get the art handle of a newly created art.

    Hi all,
    Is there any way through which we can get the art handle of a newly created art, just after its creation on the document?
    Thanks.

    Unfortunately, there is nothing to really do this. I asked for years, and eventually gave up. The best I came up with -- and it sucks -- is to watch for kArtPropertiesChangedNotifier and when that triggers, you look at the selected art and assume that was what was 'created' or 'edited'. Of course, telling the difference between the two is a problem

  • How to get selected items from a tree in backing bean without adfbc

    Hi ADF Experts,
    Below is my code for af:tree. My question is how can I get selected Items from the selectionListener (without adf bc) this uses formation of tree from backing bean.
    Using Jdev 11.1.1.7.0
    <af:tree var="node" value="#{pageFlowScope.MerchandizeBean.model}"
                      binding="#{pageFlowScope.MerchandizeBean.treeModel}"     id="tree" immediate="true" autoHeightRows="0"
                           styleClass="AFStretchWidth" rowSelection="multiple"
                           selectionListener="#{pageFlowScope.MerchandizeBean.treeNodeSelection}">
                    <f:facet name="nodeStamp">
                      <af:commandLink text="#{node.classDescription}"
                           actionListener="#{pageFlowScope.MerchandizeBean.createListManyItemForMerchandise}"           id="displayTable" partialSubmit="true">
                      </af:commandLink>
                    </f:facet>
                  </af:tree>
        public void treeNodeSelection(SelectionEvent selectionEvent) {
            // Add event code here...
            RichTree tree = (RichTree)selectionEvent.getSource();
                    TreeModel model = (TreeModel)tree.getValue();
                    //get selected value
    Thanks
    Roy

    Hi,
    in a multi select case, try
    RowKeySet rks = tree.getSelectedRowKeys();
    Iterator iter = rks.iterator();
    while(iterator.hasNext()){
    Object aKey = iterator.next();
    tree. setRowKey(aKey);
    Object rowData ? tree.getRowData();
      .... do something with the data here ...
    Frank

  • How to get the view Object in UserDefined Action

    Hi  All,
       Any body tell me how to get the view object , like the view object avilable in the wdDoModifyView() method as parameter.
    I have requirement like, i want to change the , no of rows displaying in the table should be changed at the runtime based onthe no of rows  selected in the dropdown box.
    The action which i created will be assigned to that dropdown box, on select of the available option, i will get the view object and change the properties of the "maxrows" of the table .
    so for getting the view object in the  the Action methods tell me what is the procedure for getting the current view object.

    Hello Vishal,
    Simply create a value attribute (say rowCount) of type 'integer' and bind it to the 'visibleRowCount' property of your table. Then, in the actionHandler get the value from the UI element (in your case, I guess it is drop down) and set it to the attribute 'rowCount' like this.
    wdContext.currentContextElement.setRowCount(
        wdContext.current<nodeElement>.set<AttributeBound toDropDown>);
    Bala

  • How to get selected Row Index in a table based ona  VO?

    Hi All,
    I'm writing an ADF form wherein I use a VO based on a SQL query. I'd like to know how to get the index of a selected row. I havea selection Listener in place where I can print the selected Row's data using getSelectedRowData().toString() on the table.
    How can I get certain Attributes from this selected row.
    One solution I thought of is to get the row index and then read attributes. But I cant seem to figure out how to get rowIndex for a selected row. Any sugestions?
    Using JDeveloper 11g.
    Thanks
    P.

    If your selected row is marked as current row you can use
    // Get a attribute value of the current row of iterator
    DCIteratorBinding iterBind= (DCIteratorBinding)dcBindings.get("testIterator");
    String attribute = (String)iterBind.getCurrentRow().getAttribute("field1");Where 'testIterator' is the name of the iterator you use for the table and 'field1' is the name of an attribute you want to get.
    Or you can iterate over the selected row keys (even if it's only one):
    // get  selected Rows of a table 2
    for (Object facesRowKey : table.getSelectedRowKeys()) {
    table.setRowKey(facesRowKey);
    Object o = table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding)o;
    Row row = rowData.getRow();
    TestRow testRow = (TestRow)((DCDataRow)row).getDataProvider() ;
    }Where TestRow is the row type of the VO of your table.
    Timo

  • How to get selected row from table(FacesCtrlHierBinding ).

    I'am trying to get selected row data from table:
    FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow();
    Row rw = rowBinding.getRow();
    But import for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be found from my JDev 11.
    What is correct package for FacesCtrlHierBinding?

    Hi, another problem.
    I fill table with data manualy from source:
    <af:table var="row" value="#{getCompanyData.com}"
    rowSelection="single" columnSelection="single"
    editingMode="clickToEdit"
    binding="#{getCompanyData.tab}"
    selectionListener="#{getCompanyData.GetSelectedCompany}">
    <af:column sortable="false" headerText="col1">
    <af:outputText value="#{row.id}"/>
    </af:column>
    <af:column sortable="false" headerText="col2">
    <af:outputText value="#{row.name}"/>
    </af:column>
    <af:column sortable="false" headerText="col3">
    <af:outputText value="#{row.phone}"/>
    </af:column>
    </af:table>
    and when I'am trying to use method to get selected row:
    RichTable table = this.getTab(); //get table bound to UI Table
    RowKeySet rowKeys = table.getSelectedRowKeys();
    Iterator selection = table.getSelectedRowKeys().iterator();
    while (selection.hasNext())
    Object key = selection.next();
    table.setRowKey(key);
    Object selCompany = table.getRowData();
    JUCtrlHierNodeBinding rowData = (JUCtrlHierNodeBinding) selCompany;
    row = rowData.getRow();
    I got an error:
    SEVERE: Server Exception during PPR, #1
    javax.el.ELException: java.lang.ClassCastException: data.COMPANY cannot be cast to oracle.jbo.uicli.binding.JUCtrlHierNodeBinding
    When I created tables by dragging data from date control, all worked fine.
    What could be a problem?

  • Lync Powershell help -getting error "Management Object Not found"

    Hi,
    I want to reference a list of users in Lync that do not have a HostedVoicemailPolicy applied. Please can someone help me..
    I have a list of users that form a txt file I am referencing called $lynctest.
    User1
    User2
    User3
    NoSuchUser1
    NoSuchUser2
    I have the following and its not catching the error so that I can output to another file.
    try
    foreach($lyncuser in $lynctest)
        Get-CsUser -Identity $lyncuser | select displayname, hostedvoicemailpolicy
    catch
       write-host "$lyncuser user not found" > "c:\datatemp\listofusers.txt"

    Not super efficient, but quick and dirty.  If you're talking about thousands of users, this might be too slow and we can work something else out.  If you're talking about a handful, this might be fine.
    foreach($lyncuser in $lynctest) {
    $founduser=Get-CSUser|Where-Object {$_.samaccountname -match $lyncuser}
    if ($founduser) {
    "The user exists"
    else {
    "The user does not exist"
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications
    This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • Selecting Multiple Objects with Output Preview Causing Problems

    I'm trying to edit a PDF and need to select multiple objects. Without Output Preview open, I can easily select all the items I need using the shift key. With Output Preview open, whenever I try to select the second object, Output Preview creates a sticky note, instead of selecting the second object.
    I am also using the PitStop Pro plug-in.
    Any idea how to correct this problem? Thanks!

    Unfortunately it seems that the new sticky note feature with the output preview in Acrobat XI uses the same keyboard shortcut as multiple selection tool in Pitstop (shift).
    Closing the output preview is the easiest way to get around this issue.
    We could consider changing the key for multiple selection in PitStop, but 'shift' is pretty much a default, so what could we change it too?
    If anyone has any thoughts could they email me, I am the product manager responsible for Pitstop at Enfocus and my email is '[email protected]'
    All feedback gratefully received.

  • Query to find out list of the tables getting selected frequently

    Hi All,
    Please tell me Is there any way to find out list of the tables getting selected frquently, ( please exclude the insert+updates+deletes+truncate+drop).
    Regards

    Hi Sameer
    You can check V$SQL_PLAN to see the objects being accessed by your SQL statements. If you have diagnostic licence, you can also check DBA_HIST_SQL_PLAN
    select distinct object_owner, object_name from v$sql_plan;
    select object_name, count(*) from v$sql_plan group by object_nameRemeber, this is only a crude way of finding this information.
    Regards
    Venkat

  • Can't Get Albumn Art To Import Always

    This one I've never been able figure out as it's intermittent:
    Sometimes on CDs, that I own, and rip to iTunes, if iTunes doesn't find the artwork online, I'll copy/paste the cover art in myself. Mostly it works fine. I make the art 500x500 pixels.
    - If applying the cover art to an entire album, I'll select all the songs and do Get Info and double click the "Artwork" box in the lower right of the Get Info window.
    Usually the art is imported to each song. I can see it in iTunes lower left "Selected Item" in iTunes main window.
    I can also see the art if I select a single song > Get Info > click the Artwork tab.
    And lastly, the icon in the Finder usually shows a mini thumbnail of the art.
    Problems:
    1. Sometimes: importing this way a song will not receive the art. so when I select the song within iTunes all the places the art would show is blank. And the Finder icon is generic too.
    2. Sometimes the art will import according to iTunes and you can see it in all the usual iTunes places, but the Finder icon stays generic.
    I've tried everything. I've selected the individual song and imported the art via the Artwork tab by clicking Add button. The art will then import finally, but the Finder icon stays generic while all the other songs show the correct cover art.
    If I select the song in Finder and Get Info the cover art shows in the Get Info window, but the icon in the Finder remains generic.
    If I open the song in an editing program like Fission (RogueAmoeba) and just hit SAVE, then the Finder icon goes from generic to the album art.
    Odd...

    Hey! where'd the Edit button go? It was here up until a day or so ago. Oh well... I'll do it as a Reply. I forgot to ask of you all reading this... What's the best way to import to an album that iTunes can't find using "Get Albumn Art"?
    There seems 3 ways:
    1. The Artwork window if selecting more than one song at a time
    2. The Artwork tab if selecting one song at time
    3. Drag and drop in the lower left of the iTunes main window where it says Now Playing.
    Thanks
    PS... they edit link shows on this Reply but doesn't show on my original post that started this thread. Never noticed Discussions worked that way before. Hmmm.

Maybe you are looking for

  • Error while loading entity  ORM

    entityLoad('Account') throws this error, Error while loading entity java.sql.SQLException: [Macromedia][Oracle JDBC Driver]Numeric overflow. However  entityLoad('Account',1) returns the proper record. I am using oracle 10g as a datebase. Is this a bu

  • Same as source file name when converting .msg to PDF

    Hello, When I right click a Word document and choose to convert it to an Adobe PDF file it takes a few seconds and asks me where to save it, not only this but it pre-populates the file name to match the original Word document, but obviously when save

  • The calendar app doesn't display calendar

    The calendar app on my macbook pro used to open  to a calendar when I clicked on the icon.  Suddenly, today no calendar appears when i click on the icon.  Can anyone help me resolve this issue?

  • Automatic Smart Card Certificate Renewal

    We have a problem where our Smart Card certificates are starting to expire but the automatic renewal process is failing. Is it actually possible to auto renew Smart Card certs without requiring any user input (other than the PIN)? There are two error

  • Can´t find my app button to download apps

    I can´t find my app button/app store button.