Capture Macro

397 views
Skip to first unread message

Pete

unread,
Apr 8, 2010, 3:14:39 AM4/8/10
to Orcad User Group
I am attempting to modify a macro that is supplied with Capture,
namely Titleblock.bas.
I would like it to open with the fields already filled with the
titleblock details, if they exist, is this possible and how?
TIA
Pete

Flo

unread,
Apr 13, 2010, 1:38:27 AM4/13/10
to Orcad User Group
Which OrCAD version are you using?
In 16.0 i created my own titleblock so i don't need to change any
fields by macro.
I have no idea what you are going to change with it, but (in 16.0) you
can create a macro by recording the steps.

Regards
Flo

Pete

unread,
Apr 13, 2010, 2:28:03 AM4/13/10
to Orcad User Group
I am using 16.2 at the moment.
What I am trying to do is a shortcut/alternative to
Edit>Browse>TitleBlocks to add/edit Titleblock info. This will be
cleaner than sorting amongst the many useless fields presented by the
'normal' method.

Flo

unread,
Apr 13, 2010, 10:11:58 AM4/13/10
to Orcad User Group
I am using 16.0, so I am not sure if it is the same with 16.2,
when I am editing the title block,
i am doing a double-left-click on the field i want to edit and than i
can do it....

To create a macro you open the macro folder inside your orcad
installation folder, e.g.: C:\OrCAD_16\tools\capture\macros.
Open one of the given macro files e.g. Titleblock.bas with the editor
and change it the way you want it.

I created macros to change the grid spacing, e.g.:
1.)------------------------------------------------------------------------------------
SUB BIGGRID
'MACROMENU BigGrid
'MACROKEY u
'MACRODESCRIPTION Change the Grid to big.
'Macro used with OrCAD Capture
'Copyright 2008, EN
'All rights granted provided this copyright notice is retained.
SendKeys "%op{RIGHT}{TAB 3}{UP 3}{ENTER}"
END SUB
2.)------------------------------------------------------------------------------------
SUB SMALLGRID
'MACROMENU SmallGrid
'MACROKEY z
'MACRODESCRIPTION Change the Grid to small.
'Macro used with OrCAD Capture
'Copyright 2008, EN
'All rights granted provided this copyright notice is retained.
SendKeys "%op{RIGHT}{TAB 3}{DOWN 3}{ENTER}"
END SUB
--------------------------------------------------------------------------------------

The first is activated with "u" the second with "z".
The interessting part is the "SendKeys" line.
Explanation for example 2: Alt+o -> p -> one times right -> 3 times
tabulator -> 3 times down -> Enter
Now the grid is changed to "1/10 of pin to pin" grid spacing.
The first example change it back to "1/1 of pin to pin" grid spacing.

Maybe this will help you.

Regards
Flo

Flo

unread,
Apr 13, 2010, 10:18:37 AM4/13/10
to Orcad User Group
For your example it would be:
------------------------------------------------------------------------------------
SUB SMALLGRID
'MACROMENU EditTitleblock
'MACROKEY q
'MACRODESCRIPTION To edit the title block.

'Macro used with OrCAD Capture
'Copyright 2010, EN

'All rights granted provided this copyright notice is retained.
SendKeys "%ebt{ENTER}"
END SUB
-------------------------------------------------------------------------------------

Regards
Flo

Flo

unread,
Apr 13, 2010, 10:24:27 AM4/13/10
to Orcad User Group
Sorry, in 16.0 it isn't working, macros just work in the schematics,
not in the design overview. :-(
Maybe it will in 16.2, let me know your results.

Regards
Flo

Ron_O

unread,
Apr 13, 2010, 7:24:52 PM4/13/10
to Orcad User Group
Pete (and all),
I uploaded a sample macro (Edit_TB_Properties) to the Files area. It's
an example of using the GetProperty macro function to retrieve
properties of Capture objects -in this case the Titleblock object. The
GetProperty function, for one reason or another, was undocumented and
not many examples exist of it.
The macro also demonstrates the methods for stuffing the current
property info into the dialog textboxes so it can be edited or used as
is. The OK button is cyclic, allowing the user to continue editing
properties; the Cancel button is used to end the dialog.
The titleblock must be selected to gather and update the properties.
Modify it as you see fit. I only provided the first 3 properties as
edit examples; you should be able to figure out the rest by reviewing
the macro.

Ron O

Pete

unread,
Apr 14, 2010, 2:48:27 AM4/14/10
to Orcad User Group
Thanks Ron, I'll take a look and get back.

> > > Flo- Hide quoted text -
>
> - Show quoted text -

Pete

unread,
Apr 14, 2010, 3:04:00 AM4/14/10
to Orcad User Group
Ron,
Seems to work, but not as I envisaged.
Schematics can be many pages, so I want to globally add/edit across
all sheets. Items such as Documnet Number, Issue, Date etc. are common
to all sheets, hence the requirement to globally update. In my
ignorance, I thought that as these variables are the same for all
sheets, they would all change together.
Pete

> > - Show quoted text -- Hide quoted text -

Ron_O

unread,
Apr 14, 2010, 10:04:27 AM4/14/10
to Orcad User Group
Pete,
Yes, unfortunately, macros only work within a page and not for the
global design.
The Titleblock objects are also unique items in that they don't have
specific references like parts do ie. R1, U2,ect., even though they do
have properties. Without the references, they can't be manipulated
thru a swap file nor do they appear in exported property data.
You may have to stick with your original process (which most others
use as well) -using Find| Titleblocks| selecting all| Browse
Properties and using the spreadsheet to edit and update properties
globally.

Ron O

Pete

unread,
Apr 15, 2010, 2:06:01 AM4/15/10
to Orcad User Group
Ron,
Thanks for your help, its back to the old ways then!

Dkim Tester

unread,
Jun 22, 2018, 10:55:36 AM6/22/18
to Orcad User Group
Hi, is that Edit_TB_Properties script still available somewhere?
I can't find it. 
Reply all
Reply to author
Forward
0 new messages