• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X Scripting - Skill
  3. Moving Group of Text using skill

Stats

  • State Suggested Answer
  • Replies 1
  • Answers 1
  • Subscribers 18
  • Views 5682
  • Members are here 0
More Content

Moving Group of Text using skill

vimaldevlpr
vimaldevlpr over 3 years ago

Hi,

I want to move the group of highlighted text.  The destination location by user picking i don't know how to move by group please anyone help me out from this.

Tried by below method but it works only single text but i want in group of heighted texts

event = axlEnterEvent(list('PICK), nil, t)
event ->xySnap

 This three highlighted text simultaneously move together and want to place in user clicks location. 

my code:

procedure(chk()
alist = '("A1" "A2" "A3")
axlClearSelSet()
axlSetFindFilter(?enabled '("NOALL", "TEXT"), ?onButtons "TEXT")
txtinp = axlGetSelSet(axlAddSelectAll())
axlClearSelSet()
foreach(txtinp_loop txtinp
txtinp_val = txtinp_loop->text
foreach(HighList_loop alist
if(HighList_loop == txtinp_val then
axlHighlightObject(txtinp_loop)
)
)
)
)



  • Cancel
  • Sign in to reply
  • mstaub
    0 mstaub over 3 years ago

    There isn't a clear way to do this using Skill, that I have come across at least. If you are purely looking to move text that requires the user to select the destination, you might just be better of using the move command in Allegro, and not using Skill. If for whatever reason you need to use Skill, your best bet would be to use the axlTransformObject() function, which is the closest thing you get to moving text like the 'move' command does. 

    I wrote some test code to see if this works. This code makes the following assumptions:

    - The list of text values is predefined

    - The starting point of the move is the xy location of the first selected text object.

    Text version:

    axlCmdRegister("movetextgroup" 'MoveTextGroup)

    procedure(MoveTextGroup( )
    let( ((l_txt list())
    n_x
    n_y
    l_allText
    l_txtObjs
    n_startingPoint
    n_movePoint
    n_deltaMove
    )

    l_txt = list("A1" "A2" "A3")

    ;Setup find filter and select all text in the design
    axlSetFindFilter(?enabled list("noall" "text") ?onButtons list("noall" "text"))
    l_allText = axlGetSelSet(axlAddSelectAll())

    ;Remove all text from the list but the ones we want to move. This is a quick and dirty way
    ; to do this, there is probably a more efficient way I just didn't have the time.
    l_txtObjs = setof(t_curTxt, l_allText, existss(s_t l_txt t_curTxt->text == s_t)!=nil)


    if(length(l_txtObjs) > 0 then

    ;Save the xy location of the first text element in the list
    n_startingPoint = car(l_txtObjs)->xy

    ;Prompt the user to select a destination point for the text
    n_movePoint = axlEnterPoint(?prompts list("Pick a location to move the text to.")) ; Ask user for point

    ;The axlTransformObject() function moves objects by design units and not to a specific xy location.
    ; Because of this we need to calculate what that xy delta is based on the origin of the first
    ; text object from our selection list (n_startingPoint) and the xy point the user selected.
    n_x = xCoord(n_movePoint) - xCoord(n_startingPoint)
    n_y = yCoord(n_movePoint) - yCoord(n_startingPoint)

    ;Form a coordinate variable
    n_deltaMove = n_x:n_y

    ;Move the text
    axlTransformObject(l_txtObjs, ?move n_deltaMove)
    axlClearSelSet()
    else
    println("ERROR: no objects selected to move")
    )
    )
    )

    I couldn't find a way to upload the Skill file, so hopefully this helps. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information