• 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. Object Properties

Stats

  • State Suggested Answer
  • Replies 5
  • Answers 1
  • Subscribers 17
  • Views 1778
  • Members are here 0
More Content

Object Properties

JuriVi
JuriVi 5 months ago

Hello everybody,

I want to print the attributes of the text using a loop. Example:

p = axlGetParam(strcat("paramTextBlock:" str))

text_attr_list =   '(charSpace height lineSpace name objType photoWidth userDefined width )

for(u 1 7  
 
                    attr = nth(u text_attr_list)  
                    printf("%A\n " p->attr)

    ); end for

But it does't work. My suggestion is p->attr is not correct.

Everybody knows how to fix it?

Thanks

  • Cancel
  • Sign in to reply
Parents
  • Hoangkhoipcb
    0 Hoangkhoipcb 5 months ago

    Hello!

    Why are my replies often marked as spam in this forum?

    wait admin approval for the post. so bored.

    foreach(textblock axlGetParam("paramTextGroup")->groupMembers println(axlGetParam(strcat("paramTextBlock:" textblock))->?? ) )

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JuriVi
    0 JuriVi 5 months ago in reply to Hoangkhoipcb

    Hi Hoangkhoi,

    thank you for reply. I will test it.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • JuriVi
    0 JuriVi 5 months ago in reply to JuriVi

    Thank you, it is helpfull!

    Nevertheless, do you know why my code doesn't work:

    text_attr_list =   '(charSpace height lineSpace name objType photoWidth userDefined width ) ; list of text attributes

     
                        attr = nth(u text_attr_list)  ; for u = 2 getting attr = height
                        printf("%A\n " p->attr)       ; p is e.g param:000001FF990E70A0,
                                                                 ; obtaining from p = axlGetParam(strcat("paramTextBlock:" str))

    But p->attr, means p->height brings nil. For p->height I got the real size of the text.

    What is wrong? Should be "attr" a string?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Hoangkhoipcb
    0 Hoangkhoipcb 5 months ago in reply to JuriVi

    Hi,

    I really don't know why it is wrong. But you can also refer to this code.

    (defun text_attr ()
    p = axlGetParam(strcat("paramTextBlock:1"))
    println(p)
    text_attr_list = '(charSpace height lineSpace name objType photoWidth userDefined width )
    for(u 1 7
    attr = nth(u text_attr_list)
    printf("%L\n " evalstring(strcat("p->" attr)))
    ); end for
    )

    Regards,

    HoangKhoi.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • JuriVi
    0 JuriVi 5 months ago in reply to Hoangkhoipcb

    Hi HoangKhoi,

    thank you! It works. The mistake was, the p should be a string:

    p->attr results nil

    "p" -> attr results width

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Reply
  • JuriVi
    0 JuriVi 5 months ago in reply to Hoangkhoipcb

    Hi HoangKhoi,

    thank you! It works. The mistake was, the p should be a string:

    p->attr results nil

    "p" -> attr results width

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
Children
No Data
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