Author Topic: How to create a selection filter to do this ? Seems impossible !  (Read 1875 times)

0 Members and 1 Guest are viewing this topic.

Offline snoopyTopic starter

  • Frequent Contributor
  • **
  • Posts: 767
  • Country: au
    • Analog Precision
How to create a selection filter to do this ? Seems impossible !
« on: November 04, 2018, 01:26:28 pm »
I'm starting to think the filtering capability is very limited and the query builder is useless too.

For example I want to highlight all component comments which are at 90 degrees to the component orientation so I can re-orientate them so they fit nicely within the component ? Seems you can only focus on one parameter at a time like the component angle or the text angle but not both !

Anyone have any clues because this aspect has had me puzzled for quite a while.

cheers
 

Offline voltsandjolts

  • Supporter
  • ****
  • Posts: 2299
  • Country: gb
Re: How to create a selection filter to do this ? Seems impossible !
« Reply #1 on: November 04, 2018, 04:11:45 pm »
Sounds like you need to run a script. I always struggle with API changes when trying run random scripts from the web but YMMV:

http://www.tdpcb.com/RotateDesignators.html
https://altiumpcbdesigner.blogspot.com/p/re.html
http://altiumdesignerblog.blogspot.com/2011/06/new-script-for-rotating-and-adjusting.html
 

Offline snoopyTopic starter

  • Frequent Contributor
  • **
  • Posts: 767
  • Country: au
    • Analog Precision
Re: How to create a selection filter to do this ? Seems impossible !
« Reply #2 on: November 05, 2018, 01:16:52 am »
Thanks, I have used scripts before but never wrote my own. Looks like a nightmare if you don't know what you are doing. I guess it would be easier for me just to go through the PCB and change the rotation of the comments manually. But I did notice that when you rotate a component the orientation of the comment always stays the same. Wonder if there is any way of turning this off so the comment rotates with the component ?

EDIT: Actually if you switch 'Auto Position' to Manual then the comment orientation is locked to the component orientation.

cheers
« Last Edit: November 05, 2018, 01:33:12 am by snoopy »
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 21658
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: How to create a selection filter to do this ? Seems impossible !
« Reply #3 on: November 05, 2018, 02:35:43 am »
Correct, you cannot make relational queries.

You can try a two-step query instead (query the components, change selection to the comments, query "IsSelected AND ...").

Or you can use a spreadsheet-augmented method.  Query Components, go to List, select and copy the columns including designator, position, rotation, etc.  Paste into a spreadsheet.  Query Comments, do the same.  Cross-reference the two lists (they should sort to the same length and positions, but use e.g. Excel's INDEX(MATCH(...)) combo if not), and finally prepare a query string of exactly the Comments you need to adjust.

Note that, in the Inspector, you can enter "Rotation+90" in the Rotation field to rotate counter-clockwise, rather than setting all of the selection to a constant.  Or you can make the change in the spreadsheet, and copy it back into the List Panel.

I don't think I do this much myself, but I have used similar approaches to set component placement, say when multi-channel doesn't quite work in the design, or when copying placement between files.  Or when placing, say, labels and graphics over test points, to make a drawing of them.  And similarly in schematics, or with the spreadsheet view (T, R).

So far, this has covered enough cases for me, and I haven't had any jobs so massive or strapped for time, that I had to do a more involved (scripting based) method.  But if you're interested in scripting in Altium, that's absolutely an option!

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online ajb

  • Super Contributor
  • ***
  • Posts: 2601
  • Country: us
Re: How to create a selection filter to do this ? Seems impossible !
« Reply #4 on: November 05, 2018, 09:22:32 pm »
Sounds like you need to run a script. I always struggle with API changes when trying run random scripts from the web but YMMV:

http://www.tdpcb.com/RotateDesignators.html
https://altiumpcbdesigner.blogspot.com/p/re.html
http://altiumdesignerblog.blogspot.com/2011/06/new-script-for-rotating-and-adjusting.html

That first one is what I use for this purpose, but extended to set comments and designators to the appropriate styles and layers as well.  Works fine in AD18, although sometimes I have to run it twice, but I haven't had the inclination to spend enough time in the AD scripting environment to figure out why.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf