当前位置:文档之家› TU0125 Building Script Projects

TU0125 Building Script Projects

TU0125 Building Script Projects
TU0125 Building Script Projects

Building Script Projects

Summary

Tutorial

TU0125 (v1.7) April 24, 2008 This tutorial covers the general aspects of the Scripting System and the use of Borland Delphi Objects and DXP Object Models in scripts.

Netlister, Board Outline Copier and Query Expression scripts are developed using the DXP Object Models to illustrate the power of the scripting system in Altium Designer.

This tutorial builds on the Getting Started with Scripting tutorial and is broken up into several sections: ?Scripting Fundamentals

?

Executing Scripts

?Debugging Scripts

?Using the Code Completion features

?Using Borland Objects in your scripts

?Using DXP Object Models in your scripts

?Building a Netlister project

?Building the Board Outline Copier project

?Using Query Expressions

This tutorial examines the existing real world script examples:

1. A netlist generator script utilizes the WorkSpace Manager Object Model to generate a Protel netlist format.

2. A Board Outline Copier script utilizes the PCB object model to copy the existing PCB board outline as tracks and arcs onto a specified layer.

3. A basic query expression script to run in the PCB Filter panel that searches for specified objects on a PCB document.

The DelphiScript and VBScript language sets are used in this tutorial. The DelphiScript language set is based on Borland Delphi and VBScript is based on Microsoft Scripting technology.

For information on the differences between DelphiScript and Object Pascal (used in Borland Delphi) section, please refer to the Delphi Script Reference document.

For more information on VBScript, refer to the Scripting documentation by Microsoft at

https://www.doczj.com/doc/fb16600118.html,/en-us/library/d1et7k7c.aspx

Scripting Fundamentals

Before we can start writing or debugging scripts successfully, we need to define terms that are related to scripting within Altium Designer.

?Altium Designer uses an internal DXP Run Time Library which is used by the Scripting System. In addition, Altium Designer uses a subset of the Borland Delphi Run Time Library

?DXP Run Time Library has a set of Application programming Interfaces (APIs). Each API represents an editor in Altium Designer. For example the PCB editor has its PCB API, the Schematic editor has its Schematic API and the Project Manager has its Workspace manager API and so on

?Each API has an Object Model which consist of object Interfaces. Each object interface can consist of methods and properties (but no variables).

?DXP Object Interfaces represent actual design objects in Altium Designer. You can use the DXP Object Model to extract and modify data from design documents open in Altium Designer from your scripts in DelphiScript, JScript, VBScript and EnableBasic

?Object Interfaces consist of methods and properties (but have no variables)

Building Script Projects

?You need to have the target design document open first before you can run a script using DXP Object Models. To deal with PCB documents and objects, you need to use the PCB Object Model, and to deal with Projects and documents in general, you will need to use the Workspace Manager Object Model

?You need to check the validity of Object Interfaces by either checking whether they are not Nil or using the Assigned function. For example If Assigned(Board) = True Then // do something with the board which is a IPCB_Board type.

Script Units and Forms

? A Script Form has two views – the Script Code view and the Script Form view. The Script Code view contains event handlers and procedures/functions. The Script Form view represents a dialog form (of different types) and have controls and their associated event handlers.

? A Script Form has two associated files. A *. PAS file that contains has event handlers and procedures/functions and a *.DFM file that has details of the script form itself, the components on this form, and their locations on this form as well.

? A component is a control that accepts the user’s input such as a mouse click or a sequence of characters entered.

Components are visual or non visual control objects on the Tool Palette panel that can be manipulated on a Script Form using the Object Inspector panel during design.

? A component has methods, properties, and events. Methods are the actions an object can perform. Properties represent the data contained in the Object Interface which can be accessed or modified. Events are conditions a component on a Script Form can react to. There are event handlers in a Script Form that process captured conditions. The Components

(implemented with Borland DelphiTM) can be used in any Script Form in any language set supported by the Scripting system.

Consult the Scripting Resources accessible through the bottom part of the Knowledge Center panel in Altium Designer.

Navigate to the appropriate API reference document via Configuring the System ? Scripting in Altium Designer ? Altium Designer RTL Reference.

Building Script Projects

Executing Scripts

A Script Project helps you to manage your scripts. There are two script types, Script Units and Script Form. Any script (using the same language set) within a project has access to global variables and procedures so it is important to have unique procedure and global variable names.

To run a script that requires access to DXP Object Interfaces, you need to run the script on the currently focused and specific document type. For example, if your script has PCB functions to update PCB design objects and you attempt to run the script in the text editor, you will get undeclared identifier errors. Therefore, it is imperative to check for the presence of a PCB document first before proceeding with the script that has the PCB Object Interfaces.

You can install script projects in the Installed Projects list which means these projects are seen as global to Altium Designer. The global variables and procedures from these scripts are available for use in other open script projects. To make your script project global, navigate to the DXP ? Preferences menu and drill down to Scripting System folder. Click the Install button which brings up the Select Script Project File dialog. Navigate to your script projects and click OK. Repeat for all script project that you would like to make globally available.

For an introduction to scripting, refer to the Getting Started with Scripting

tutorial

For more general information on resources in Altium Designer, refer to the tutorial, Customizing the Altium Designer

Also refer to the script examples, mostly in DelphiScript, in the \Examples\Scripts\ folder which are available for

experimentation.

Running a Script from the Run Process dialog

To run a script from the Run Process dialog (DXP ? Run Process ), You will need to specify the full path to the script project and specify which script unit and procedure in order to execute the script. Two parameters need to be specified: the ProjectName and the ProcName parameters.

There are two parameters in this case: the ProjectName and the ProcName . For the ProcName parameter, you need to

specify the script filename and the main procedure in this script. The format is as follows: ProcName = ScriptFileName > ProcedureName. Note the GreaterThan (>) symbol used between the script file name and the procedure name. Thus, to execute a script from the Run Process dialog: Process: ScriptingSystem:RunScript

Parameters: ProjectName = PathToProject | ProcName = ScriptFileName > ProcedureName

Note (Parameter = Value) blocks are separated by a Pipe (Vertical Bar) symbol eg Param1 = Val1 | Param2 = Val2.

For example, to run a DXPVersion script in Altium Designer from the Run Process dialog, we need to have

ScriptingSystem:RunProcess in the Process: field and ProjectName = C:\Program Files\Altium Designer\Examples\Scripts\Delphiscript Scripts\Dxp\DXPVersion.PrjScr | ProcName =

DXPVersionUnit.pas > DXPVersion in the Parameters: field. The exact path for the ProjectName parameter depends on the installation path of Altium Designer.

Running a Script from a key, toolbar or menu item

You can assign a script to a server menu, toolbar or hot key in Altium Designer and making it possible for you to run the script in your current document. For example to run the open the PCB document and then:

1. Double click on the menu or alternatively use the DXP ? Customize command, the Customizing PCB Editor dialog appears.

2. Click on the [Custom] entry on the Categories part on the left side of the dialog. Then click on the New button and then the

Edit Command dialog appears. 3. Click on the Browse button adjacent to the Process field and select the ScriptingSystem:RunScript process.

Building Script Projects

4. Define the ProjectName and ProcName parameters in the Parameters field of the dialog. For example; ProjectName =

C:\Program Files\Altium Designer\Examples\Scripts\Delphiscript

Scripts\Dxp\DXPVersion.PrjScr | ProcName = DXPVersionUnit.pas > DXPVersion in the Parameters: field. The exact path for the ProjectName parameter depends on the installation path of Altium Designer.

5. Name this new command in the Caption field of this dialog and if desired, assign the text in the Description field and a new

icon in the Bitmap File field in the Edit Command dialog. Click the OK button to close this dialog.

6. The new commands appear in the [Custom] category of the Categories list. Click on the [Custom] entry from the

Categories list. The new command appears in the Commands list of this dialog.

7. Drag and drop the new command from the Customizing PCB Editor dialog onto the PCB menu. The command appears on

the PCB menu (if you have not assigned a bitmap, then the Caption of this command will appear instead). Click on this command to run the DXP Version Script.

For an introduction to scripting, refer to the Getting Started with Scripting tutorial

For more general information on resources in Altium Designer, refer to the Customizing the Altium Designer resources

tutorial

Building Script Projects

Debugging a Script

There are various tools in the scripting system to help you debug your scripts including using break points in your script, using the Watches List panel to monitor the variable values, using the bookmarks in the script to jump around more efficiently, and using step in or step out facilities to step through the scripts.

When a script contains an error, the script is stopped by the debugger. You can stop the script using the Stop button on the menu and make changes to the script. Save changes and re-start the script.

To check the values of the variables in your scripts, you can utilize the following features in the scripting system:

?Modal dialogs (such as ShowMessage and MsgBox functions)

? Messages panel

? Breakpoints

?Expression Evaluation tooltips

?Symbol Insight tool tips

? Evaluate dialog

Consult the guide, A Tour of the Scripting System to learn more about debugging scripts and script panels.

Common Debugging Dialogs

The ShowMessage, ShowInfo, ShowWarning and ShowError procedures from DXP Run Time Library (part of Altium Designer application and exposed through the Scripting System) can be used as simple tools for displaying data values or to track the sequence of events of your script in any language set you use.

The VBScript in Altium Designer has built in functions that can be used in your VBScript script projects, one of the common functions is the MsgBox function.

ShowMessage Example

Procedure HelloWorld;

Begin

ShowMessage('Hello world!');

End;

The Messages panel

The Messages panel is a very useful debugging tool for scripting, this panel is a workspace manager object. You can use the Messages panel as a debugging dialog that shows states of variables and properties from your script. An example of using the Message Panel in your script to capture data values or states is shown below.

Example

Var

WSM : IWorkSpace;

Begin WSM := GetWorkSpace;

If WSM = Nil Then Exit;

// Clear out messages and initialize the Message panel

WSM.DM_ClearMessages;

WSM.DM_MessageViewBeginUpdate;

WSM.DM_ShowMessageView;

// Display states or values of data with DM_AddMessage procedures

WSM.DM_AddMessage('MessageClass 1', 'MessageText 1',

'DXP Message 1', '1', '','', 3, False);

WSM.DM_AddMessage('MessageClass 2', 'MessageText 2',

'DXP Message 2', '2', '','', 3, False);

WSM.DM_MessageViewEndUpdate;

WSM.DM_ShowMessageView;

Building Script Projects

End;

Trapping Errors in your DelphiScript Scripts

The use of Try Finally End and Try Except End blocks are useful to catch exceptions in your DelphiScript scripts. The major limitation of a Try Except End block is that you cannot define custom exceptions but only use a text string for the Raise statement.

Example

Try

X := Y/Z;

Except

Raise(‘A divide by zero error!’);

End;

The Raise keyword is related to the Try keyword. The Raise keyword can be used without parameters to re-raise the last exception. It can also be used with a string parameter to raise an exception using a specific message. An example is

Raise(Format('Invalid Value Entered : %d', [Height]));

Note, the On keyword is not supported in DelphiScript, and consequently you cannot use Exception objects in scripts unlike in Borland Delphi programming projects.

Trapping Errors in your VB scripts

The use of On Error statement can be used in your VB Scripts. Consult the Scripting documentation from the MSDN website (https://www.doczj.com/doc/fb16600118.html,) for more information on trapping errors.

Using the Code Completion features

The Scripting System supports the Code Completion facility. Server scripting panels include the Code Explorer, etc. The Code Explorer panel which displays the variables, methods and objects is used by the script in the tree-like panel.

Code Completion

The Code completion feature utilizes a script pop up window which shows available methods and objects once you have entered the period character (the dot/fullstop character) after the variable name in the script. You can also use the CTRL + SPACE shortcut keys to bring up the Code Completion options on demand.

Script Templates

You can use the script template feature to automatically generate a complete statement for you when you press the CTRL + J shortcut keys after you have typed the first few letters of the statement.

Script Parameters

You can use the Script Parameters feature to inspect which parameters are used for a particular function/procedure/method of an object interface. Use the SHIFT + CTRL + SPACE keys to display the parameters pop up message.

Building Script Projects

Expression Evaluation ToolTip

The Expression Evaluation ToolTip feature displays data values for the variable that the cursor is hovering over.

Symbol Insight ToolTip

The Symbol Insight ToolTip feature shows the variable type when the mouse cursor is hovering over the variable. This information can also be accessed by pressing the CTRL key.

Consult the guide, A Tour of the Scripting System for more information on debugging scripts and script panels.

Building Script Projects

Using Borland Delphi Objects in your Scripts

The Scripting System handles two types of components for script forms: Visual and Non-visual components. The visual components (Button, Edit and Memo components for example) are the ones you use to build the user interface. The non-visual components are used for different tasks such as Timer, OpenDialog and MainMenu components. You use the Timer non-visual component to activate specific code at scheduled intervals which is not visible to the user.

Components are also called controls. All Script Forms have one or more components. Any combination of components can be placed on a Script Form and while your script is running, a user can interact with any component on a form. It is your task to decide what happens when a user clicks a button or changes a text in an Edit box. Both visual and non-visual components appear at design time but non visual components are not visible at runtime. These components come from the Borland Run Time Library in Altium Designer.

Dropping Components onto a Script Form

The Scripting system supplies a number of components for your scripts. You can find all of the components you can place on a Script Form on the Tool palette. To place a component on a form, locate its icon on the Tool Palette panel and double-click it. This action places a component on the active form. When you drop a component onto a form, the Scripting system automatically generates the code necessary to use the component and updates the script form. You do not need to create or destroy these objects, the script form does them for you automatically.

Set the properties, add code in the event handlers and use methods as necessary manipulate your component on the Script Form. You can also use the Object Inspector to manipulate the properties of a component on the Script Form.

Creating Components from the Script Form

You can directly create and destroy components in a script – normally you don’t need to pass in the handle of the form because the Script Form takes care of it automatically for you, so you normally pass a Nil parameter to the Constructor of a component.

Example of creating a TOpenDialog component

Function LoadAFile : String;

Var

OpenDialog : TOpenDialog;

begin

Result := ‘’;

OpenDialog := TOpenDialog.Create(nil);

OpenDialog.InitialDir := ‘C:\’;

// Display the OpenDialog component

OpenDialog.Execute;

// Obtain the file name of the selected file.

Result := OpenDialog.Filename;

OpenDialog.Free;

End;

Note, you can also use the CreateObject function as provided by the DelphiScript language and this function can take in multiple parameters, for example

Procedure DemoCreateObjectFn;

Var

OpenDialog : TOpenDialog;

Begin

// the CreateObject function takes in two parameters -

// the TOpenDialog class and a Nil parameter

OpenDialog := CreateObject(TOpenDialog, nil);

OpenDialog.Execute;

End;

Building Script Projects

Instantiating Borland Delphi Classes

For other Borland Delphi objects such as the TStringList object, you can use some of the classes from the Borland Delphi Run Time Library to create them during the duration of the script. Normally in scripts, you can use these classes to create objects and store information in these objects then free them when they are no longer in use. It is your responsibility as a coder to create and free objects where appropriate.

Procedure Demo_TStringList_Class;

Var

AList : TStringList;

Begin

Try

AList := TStringList.Create;

AList.Add(‘Line 1’);

AList.Add(‘Line 2’);

AList.SaveToFile(FileName);

Finally

AList.Free;

End;

End;

You can use a subset of the Borland Delphi classes in your scripts. Consult the Helper Functions and Objects section in the

System Reference document for details on the use of Borland Delphi classes and functions in your scripts.

Building Script Projects

Using DXP Object Models in your scripts

Altium Designer is composed of a single Client executable along with plugged in servers. The Client deals with actions generated by the user of the Altium Designer application. The servers provide specialized functionality depending upon the task

requested by the user.

Client

WorkSpace Manager

Schematic Editor P r o t e l P C B E d i t o r

T e x t E d i t o

r

Add-ons

S e r v e r S i d e

O u t p u t G e n e r a t o r s

F P

G A E d i t o r

The Client – Server architecture of DXP

C l i e n t S i d e

The scripting system has access to the DXP Object Models from the DXP Run

Time Library as well as a subset of Borland Delphi Run Time Library. You need not worry about where the functions or objects come from – they are readily accessible for use in scripts. The DXP Object model consists of PCB Object Model, Schematic Object Model and the WorkSpace Manager Object Model etc.

From the diagram below, a Design project is represented by the IProject

interface as part of the WorkSpace Manager Object model. The PCB document is represented by the IPCB_Board interface from the PCB Object Model.

In this tutorial, the Workspace Manager Object Model will be used to retrieve the connectivity information of the schematic project to generate a netlist. The PCB Object model is used to fetch PCB objects from a PCB document.

Consult the Scripting Resources accessible through the Knowledge Center panel in Altium Designer. Navigate to the

appropriate API reference document via Configuring the System ? Scripting in Altium Designer ? Altium Designer RTL Reference .

Refer to the script examples, mostly in DelphiScript, in the \Examples\Scripts\ folder of the Altium Designer installation which are available for experimentation.

Building Script Projects

Building a Netlister Project

The aim of this Netlister is to generate a Protel netlist (either Version1 or Version 2 formats) for the Project containing schematics. A flat netlist of a schematic project is separated into two sections – component designators and the information associated with each component, and net names and the information associated with each net name along with pin connections (pins of a component).

From the WorkSpace Manager Object Model, there are interfaces that represent the project and its constituents – the documents, the components and its pins, and the nets. The WorkSpace Manager is a system extensions server coupled tightly with the Client module and deals with projects and their associated documents. This server provides compiling, multi sheet design support, connectivity navigation tools, multi-channel support, multiple implementation documents and so on. To retrieve the WorkSpace Manager interface, invoke the GetWorkspace function which yields you the IWorkspace interface.

We need to concern ourselves with the IWorkSpace, IProject, IDocument, IComponent, IPin and INet interfaces. You may notice that some of the interfaces, especially the design object interfaces correspond directly to Schematic Object interfaces. For example, IPin and INet correspond directly to ISch_Pin and ISch_Net interfaces respectively. It is because the logical documents in a project are schematic documents with connectivity information. In fact, we can use the Schematic Object model instead, but the Workspace Manager provides us the functionality to compile a project, extract documents of a project as well as retrieving data from schematic objects.

Main parts of a Netlister Script

The main parts of the script are

? A global TargetFileName string which is the file name of the netlist

? A global Netlist TStringList collection object which contains the data of the netlist

?WriteComponent and its WriteComponent_Version1 and WriteComponent_Version2 routines

?WriteNet and its WriteNet_Version1 and WriteNet_Version2 routines

?ConvertElectricToString which converts a pin’s electrical property to a string

? GenerateNetlist procedure

The Functionality of a Netlister

The netlister is based on the ScripterProtelNetlist.pas script from the \Examples\Scripts\DelphiScript

Scripts\WSM\Protel Netlister\ folder of the Altium Designer installation. We will go through the netlister script step by step.

1. The two parameter-less procedures with GenerateProtelV1FormatNetlist and GenerateProtelV2FormatNetlist names will

appear in the Select Item to Run dialog. You have the choice of generating a Protel V1 format netlist or a Protel V2 format netlist. These procedures will call the GenerateNetlist procedure.

The two procedures in the Select Item to Run dialog

Procedure GenerateProtelV1FormatNetlist;

Var

Version : Integer;

Begin

// Protel 1 Netlist format, pass 0

GenerateNetlist(0);

End;

Procedure GenerateProtelV2FormatNetlist;

Var

Version : Integer;

Begin

// Protel 2 Netlist format, pass 1

GenerateNetlist(1);

End;

Building Script Projects

2. The GenerateNetList procedure gets the workspace interface so that the project interface can be extracted for the

current project. The project needs to be compiled before nets can be extracted, as the compile process builds the

connectivity information of the project. The project interface’s DM_Compile method performs this in the code snippet below.

WS := GetWorkspace;

If WS = Nil Then Exit;

Prj := WS.DM_FocusedProject;

If Prj = Nil Then Exit;

// Compile the project to fetch the connectivity info for design.

Prj.DM_Compile;

3. The component and net information is stored in the Netlist object of TStringList type which is used later to generate a

formatted netlist text file. The TStringList object is a Borland Delphi class part of the Classes unit of the Borland Delphi Run Time Library which is available to use in scripts.

4. A netlist is broken up into two sections so two procedures are required to write component data and net data separately. For

nets, at least two nodes in a net will be written to a netlist, anything less than two nodes is discarded. For each net, the net name is based on the Net’s DM_CalculatedNetName method which extracts the net names from the connectivity

information generated by the compile. Two code snippets for the Components and Nets sections of a netlist are shown below for Protel Version 1 format. Remember component and net data are stored in the NetList object which is a

TStringList type.

5. The Generate procedure obtains the output path of a project for the netlist file to go in. Then with all the schematic

documents in a project, each document is checked for nets and components and they are then extracted to the Netlist object.

6. When a netlist is generated, it is composed of two sections; the component information section and the net information

section.

Components Section

In this section, for each component found from the Project, it is checked if it is an actual component and then the physical designator, footprint and part type values are extracted.

If Component <> Nil Then

Begin

NetList.Add('[');

NetList.Add(Component.DM_PhysicalDesignator);

NetList.Add(Component.DM_FootPrint);

NetList.Add(Component.DM_PartType);

NetList.Add('');

NetList.Add('');

NetList.Add('');

NetList.Add(']');

End;

Nets section

In this section, if a net has two pins or more, then the NetName and the designators are extracted.

If Net.DM_PinCount >= 2 Then

Begin

NetList.Add('(');

NetList.Add(Net.DM_CalculatedNetName);

For i := 0 To Net.DM_PinCount - 1 Do

Begin

Pin := Net.DM_Pins(i);

PinDsgn := Pin.DM_PhysicalPartDesignator;

PinNo := Pin.DM_PinNumber;

NetList.Add(PinDsgn + '-' + PinNo);

Building Script Projects

End;

NetList.Add(')');

7. Save the script and then execute the RunScript command from DXP menu. The Select Item to Run dialog appears. Choose

either GenerateProtelV1FormatNetlist or GenerateProtelV2FormatNetlist procedure and a netlist will be generated and opened in Altium Designer automatically.

You can open the Scripter_ProtelNetlist.PrjScr project and execute the ScripterProtelNetlist.pas

script from the \Examples\Scripts\DelphiScript Scripts\WSM\Protel Netlister\ folder.

Building the Board Outline Copier Project

The aim of this Board Outline Copier is to copy an existing board outline from the PCB document to a different layer in the same document. Using the PCB Object model and its PCB interfaces from the PCB API, we can extract objects of a board outline and copy these objects onto a specified layer.

We will be using a Script Form so that user can input the width of the board outline and select the layer from a drop down menu. Let’s start dissecting the board outline copier script but this time in VBScript! The Board Outline Copier example can be found in \Examples\Scripts\VB Scripts, \Examples\Scripts\JScript Scripts and

\Examples\Scripts\DelphiScript Scripts\PCB folders.

Main parts of a Board Outline Copier script

The main parts of the VB script script are

? A global PCB_Board (of IPCB_Board type) variable

?CopyBoardOutline sub routine with AWidth and ALayer parameters

?bCancelClick event handler which closes the Board Outline script form

?bOkClick event handler which obtains the width and layer values from the script form and then executes the CopyBoardOutline subroutine.

The Functionality of a Board Outline Copier script

Since we are using a script form, we need to have event handlers to capture the mouse clicks of individual controls such as the Cancel and OK buttons. The OK Click event handler obtains the Width of the outline in Internal coordinate values from the StringToCoordUnit function and the Layer enumerated value from the String2Layer function.

Both functions come from the Altium Designer Run Time Library which is available to use in scripts. Load the CopyBoardOutlinePRJ.PRJSCR project and check out the CopyBoardOutlineForm Script form.

IPCB_Board Interface

A board outline is obtained from the IPCB_Board interface via the PCBServer function and it needs to be initialized first before proceeding with copying and creating a new board outline.

Board Outline has Arc and Track segments

The board outline is represented by the IPCB_BoardOutline interface and this interface is inherited from the IPCB_Group interface. A IPCB_Group interface represents a group object that can store child objects. An example of IPCB_Group interface is a polygon or a board outline because they can store arcs and tracks.

A board outline object stores two different type of segments – ePolySegmentLine and ePolySegmentArc which represent a track or arc object respectively The number of segments is determined by the PointCount method from the

IPCB_BoardOutline interface.

Each segment of this board outine needs to be checked for tracks and arcs with the If

PCB_Board.BoardOutline.Segments(I).Kind = ePolySegmentLine Then statement.

For each segment found and depending on the segment kind, a new track or arc is created.

PCBObjectFactory and AddPCBObject Methods

Creating a PCB object employs the PCBObjectFactory method from the IPCB_ServerInterface interface. In this case, the PCBServer.PCBObjectFactory(eArcObject, eNoDimension, eCreate_Default) statement creates a new Arc object. A new copy of an arc object is added onto a specified layer of the PCB document with the

PCB_Board.AddPCBObject(NewObject) statement.

Building Script Projects

PreProcess and PostProcess methods

For each PCB object creation, you need to apply the PreProcess method from the IPCB_ServerInterface object interface before creating a PCB object, and then after creating this PCB object, you need to apply the PostProcess method from the IPCB_ServerInterface interface. Below is a code snippet with PreProcess and PostProcess statements.

PCBServer.PreProcess

//create a PCB object

PCBServer.PostProcess

The PreProcess and PostProcess methods keep the Undo/Redo system up to date and synchronized in the PCB editor. Setting the new PCB Layer

When objects are added to a layer that has not been displayed in the PCB document, we need to force this layer to be visible. This PCB_https://www.doczj.com/doc/fb16600118.html,yerIsDisplayed(ALayer) = True statement does this job.

Refreshing the PCB Document

Finally the PCB document is refreshed with the new board outline on a new layer with the PCB:Zoom command and using the Action = Redraw parameters.

You can open the CopyBoardOutlinePRJ.PRJSCR project and execute the CopyBoardOutlineForm.vbs script from

the \Examples\Scripts\VB Scripts\ folder.

Building Script Projects

Using Query Expressions in Scripts

The Filter panel in Schematic and PCB has the ability to execute scripts that have query expressions to filter and select certain objects.

To be able to execute query scripts, these script projects must be installed in the Installed Projects list, so that they are made global to Altium Designer.

Go to the DXP ? Preferences menu and when the Preferences dialog appears. Click on the System folder and drill down to Scripting System folder on the left pane of the Preferences dialog to install scripts in the Installed Projects list on the right

side of the dialog.

A query script must have a function name that returns a boolean value. Inside the function block contains the query expressions. The function name is entered in the PC

B Filter

panel’s expression window as shown below.

An example will be demonstrated how a query expression incorporated in a script can be executed in the query box on the PCB Filter panel. A simple query expression that looks for components with pads that have zero hole sizes is presented below. This script can only be executed on a PCB document.

Building Script Projects

Function HighlightPadsWithZeroHoleSize : Boolean;

Begin

Result := False;

// Check if PCB document exists, if not, exit.

If UpperCase(Client.CurrentView.OwnerDocument.Kind) <> 'PCB' Then Exit;

Result := IsComponentPad and (Holesize = 0);

End;

Refer to the Query Expression Script examples which can be found in \Examples\Scripts\Query Scripts\ folder.

Consult the Query Language Reference and Introduction to the Query Language documents to obtain more information on

PCB and Schematic query expressions.

Conclusion

You have learnt how to create a script project and investigated three scripts that use WorkSpace Manager Object Interfaces, PCB Object Interfaces and Query Expressions.

Consult the Scripting Resources accessible through the Knowledge Center panel in Altium Designer. Navigate to the

Scripting resources via Configuring the System ? Scripting in Altium Designer.

Explore various script examples in the \Examples\Scripts folder.

Building Script Projects Revision History

Revision

Date Version

No.

30-Nov-2004 1.0 New product release

4-Apr-2005 1.1 Updated for Altium Designer

15-Dec-2005 1.2 Updated for Altium Designer 6

updates.

18-Jan-2006 1.3 Minor

2-Mar-2006 1.4 Fixed the wrong title on page 11.

29-Nov-2007 1.5 Updated for Altium Designer 6.8

26-Mar-2008 1.6 Updated Page Size to A4.

24-Apr-2008 1.7 Updated file paths.

Software, hardware, documentation and related materials:

Copyright ? 2008 Altium Limited. All Rights Reserved.

The material provided with this notice is subject to various forms of national and international intellectual property protection, including but not limited to copyright protection. You have been granted a non-exclusive license to use such material for the purposes stated in the end-user license agreement governing its use. In no event shall you reverse engineer, decompile, duplicate, distribute, create derivative works from or in any way exploit the material licensed to you except as expressly permitted by the governing agreement. Failure to abide by such restrictions

may result in severe civil and criminal penalties, including but not limited to fines and imprisonment. Provided, however, that you are permitted

to make one archival copy of said materials for back up purposes only, which archival copy may be accessed and used only in the event that the original copy of the materials is inoperable. Altium, Altium Designer, Board Insight, DXP, Innovation Station, LiveDesign, NanoBoard, NanoTalk, OpenBus, P-CAD, SimCode, Situs, TASKING, and Topological Autorouting and their respective logos are trademarks or registered trademarks of Altium Limited or its subsidiaries. All other registered or unregistered trademarks referenced herein are the property of their respective owners and no trademark rights to the same are claimed. v8.0 31/3/08

domino权限

Domino数据库存取控制列表(ACL) 在Domino中,数据库的存取控制列表是Domino安全性的重要组成部分,也是决定每个用户能否访问数据库的主要设置。每个数据库都有自己的存取控制列表(Access Control List, 以下简称ACL)。打开一个数据库,选择菜单“文件”-“数据库”-“存取控制”,就可以看到该数据库的ACL。 ACL分为四个页面:基本、角色、日志和高级。以下分别说明这四个页面中的内容。并说明了ACL中可以接受的名称格式。 ACL的“基本”页面 ACL的核心功能都包含在“基本”页面中。在“个人/服务器/工作组”中选择“全部显示”,所有存取级别的用户都会被列出。也可以选择仅查看“管理者”、“设计者”等某个存取级别的用户。当选中某个用户名时,对话框中会显示他的用户类型和存取级别,以及与此存取级别相应的一些扩展和限制选项。用户类型和存取级别指定了用户对此数据库的最大权限。数据库的管理员可以增加、删除或修改用户的权限。

七个存取级别 ACL中共有七个存取级别:管理者、设计者、编辑者、作者、读者、存放者和无访问权限。了解这些级别的含义是了解ACL工作机制的基础。下图显示了每个存取级别的缺省权限,从无访问权限开始,每个级别都比下一级拥有更多的权限,直到拥有所有权限的管理者。(每个级别的权限都包含其下所有级别的权限)。

无访问权限 此级别表示用户没有任何权限,不能存取数据库。管理员可以开放给无访问权限的权限只有“读取公用文档”和“写公用文档”。关于公用文档的概念,见下面的“读写公用文档”部分。 存放者和读者 存放者只能向数据库中放入文档,但不能读取这些文档。读者则只能读文档,但不能向数据库中放入文档。二者都只具有单一的功能。(读者拥有一个额外的权限,可以执行代理)。 作者 作者可以创建、修改、删除文档。但是,要想使拥有作者权限的用户能够修改、删除文档,还需要作进一步的设置:要创建文档,需要选中“创建文档”选项。要修改文档,需要设置文档中的作者域。要删除文档,需要选中“删除文档”选项,同时需要设置文档中的作者域。 在设计数据库时,有一类特殊的域称为作者域,这种域的类型是“作者”。在文档中,作者域可以包含用户、群组或角色的名称。如果一个用户在ACL中具有作者权限,同时,他的名字又包含在文档的作者域中,那么,这个用户就是该文档的所有者之一,可以修改此文档。如果用户未被包含在作者域中,则即使此文档是由他创建的,也无权修改它。 作者域只对存取级别为作者的用户起作用。其他的存取级别不受

creo原创教程液压管路布局roe高级应用之管道设计

creo原创教程(三),液压管路布局 proe高级应用之管道设计 今天creo给大家带来高级应用的管道设计,昨天发布的曲面展平和实体自由形状,希望大家能够支持,其中曲面展平教程已经被加入到精华帖, 好高兴,种子终于结果了,希望大家错支持,多回复,您的回复是我继续发好贴的动力。 管道设计一般情况下我都用sweep (走管布局简单的),稍微复杂点的就得vss或sweep blend,还有很多用管道设计模块。 建立点,根据点建立曲线,复制合并成一条曲线,然后再vss或sweep blend 这个完全可 以,个人感觉常规办法都是这样,我以前也是这样做的,今天给大家做个插入-高级引用的管道设计,相信你看后一定会会经常用到这个的。管道设计模块我没有用过,如果大家有异议,可以发帖共同交流

1.我先建立几个障碍,走管绕过这些障碍. 2.建立几个基准面,再建立点,这些点要穿过障碍,不能在每个障碍上,基准面要建立点适当看 图,这些基准面和点的建立有一定的经验成分在里面,不过不用担心,即使你现在的面和电建立的不 好,到时候可以调整 3.点击插入--高级--管道,弹出菜单管理器,这里用默认的就可以,几何就是点线面,空心,你的管 道不可能是实心对吧,常数半径,这个可以随意一些,到时候和障碍有冲突,可以设置多重半径,一 般情况下我都设置为常数,点完成,输入外部直径我输入10,管道壁厚为,添加点,根据你的 管道的走向顺次选取点,别忘了按住ctrl键,到拐弯的时候让你输入折弯半径,这个也有一定的经验 在里面,一次不行可多次,一步一步来,点选每个点后,

出现个箭头,箭头的方向代表该点所在曲线 曲率的方向,也就是切线的方向,选择完最后一个点,点击鼠标中间,可以看到管路建立好了。 如果觉得不满意,可以再调整一下点,教程管道的设计比较简单,实际情况比这个复杂的也有很多, 这里只提供思路,做管道设计,尤其是液压系统的设计,建议用这个种方法,比较好控制,如果vss或者sweep blend,单单是合并曲线就够你忙活一会了,有人会问,为什么sweep不行么,我可以告诉你,合并的复杂曲线sweep是扫描不到的,这里就不能用sweep,简单的在一个平面内的简单的曲线可以用sweep。 您的支持是我继续发布教程的动力!!! KB, 下载次数: 40)

Lotus Script语法基础篇

Lotus Script语法基础篇 注释 注释在程序运行中并不执行,只是让程序员在编写程序的时候添加的一些标记性的文字,但他的作用可不容忽视,在编写一个程序模块时说明这个模块的功能、作用、创建时间、作者等,这对以后的维护大有好处。一般在用户的脚本中插入头信息是一个不错的想法,如下事例: ‘Script name: Connect internet ‘Author: zynet ‘Last Modified: 6/23/08 ‘Description: Connect my webserver. 1.单行注释:通过输入一个单引号( ‘ )或REM ( Remark的缩写 )来添加。 2.多行注释:%Rem …%End Rem 所以以上例子也可以写成这样: %REM Script name: Connect internet Author: zynet Last Modified: 6/23/08 Description: Connect my webserver. %END REM 变量和数据类型 1.声明变量 Dim Variablename as type dim是dimension的缩写,为变量的值在内存中创建一个空间。 Variablename 是变量的名称,一个变量的名称一定要以字母开头,其后可以是字母、任何数字以及下划线,变量的名称不区分大小写,最多可容纳40个字符。Lotus中有一些保留字,大部分是指令和语句,它们不能被用做变量名。 type是数据类型,可以是Boolean、Byte、Integer、Long、Single、Double、Currency、String、Variant 当然以后在介绍面象对象的时候还涉及到类和对象的定义,也是这个声明格式,这些在以后再介绍。 类型值 Size

Creo原创教程(十三),布局—骨架运用之自动装配

Creo原创教程(十三),布局—骨架运用之自动装配 自从发布了几个关于top-down的教程,有人问“布局的东西讲了几篇了,怎么没有自动装配教程呢,布局不是能够实现自动装配么?”,不错,自动装配从字面意思来讲自动,就不用人工,就不用人了,让零件自东装配到组件中,如果你要是这样想,估计没必要再往下看了,可以想一下,现在的机器人,能够自动实现一些人类做不到的动作或是操作,这样确实是省了人工,但是,前期机器人在开发,在他每一个动作编程,和他零件、组件、电路的设计的时候是需要大量的人工,不断的调试,不断的改进。 布局实现自动装配也是前期你的人工,到后来装配时省力,相当于你告诉proe,我的螺栓轴心对准那个孔,螺栓头底面和孔表面哪个面对齐,前期得告诉他,他才能知道怎样装, 你怎样告诉他?? 自动装配,你零件少时,就可以不用它,当零件多时,你会发现,自动装配非常的省力,非常的方便,涉及到的复杂的自动装配,我们在以后的教程中继续来讲解。今天先看这个例子 布局,通过声明布局就能够实现了它的自动装配。 实例,油缸的那个例子 1. 事先建立好零件,然后到组件上下建立基准,在零件下声明布局, 例如我们要建立如图1的油缸组件,我们首先要确定,每个运动组件的铰接点到各个基准的距离,这是首先要做到的,当然,如果你是应用骨架模型的话,你就可以用骨架模型来设置这些基准。骨架模型我们之前的那个教程里面有个skeleton-1.prt的骨架模型,我们就用你那个骨架来生成基准,如图2

图1 图2

,新建立一个组件名为auto.asm,, 借助骨架来生成基准,通过复制几何的方法,进行数据传递,如图3

在 IBM Lotus Domino Designer 中使用 Java 构建应用程序

在 IBM Lotus Domino Designer 中使用Java 构建应用程序 Oscar Hernandez, 高级软件工程师, IBM 简介:本文旨在帮助那些传统的 LotusScript 开发人员转向 Java 开发。在几乎不具备 Java 知识的情况下,本文可帮助您开始在 IBM Lotus Domino 中进行Java 应用程序开发。 简介 对于 IBM Lotus Notes 应用程序开发人员来说,LotusScript 和 LotusScript 类在设计 Notes 应用程序时很有用。LotusScript API 支持以编程方式与数据库、文档,甚至设计元素进行交互。随着 Java 发展成为主流编程语言,原来越多的 Notes 应用程序开发人员开始将目光投向 Java。 本文面向那些想要在 IBM Lotus Domino 中使用 Java 进行编程的 LotusScript 开发人员。假定读者具有一定的 LotusScript 编程经验。 本文包含三部分:Java 语言、示例和其他要素。Java 编程人员可以直接跳到示例部分,但是新手应该从 Java 语言部分开始阅读。 Java 语言 发布于 1995 年,Java 是一种面向对象的编程语言,它的出现满足了平台独立性需求。这是通过将 Java 源代码编译成字节码实现的,然后任意平台上的任何Java 虚拟机(JVM)都可以解释字节码。 因此,只要为目标平台实现了 JVM,就可以运行任何 Java 应用程序。有关更多信息,请参见“The History of Java Technology”。 Java 的语法类似于 C,而它面向对象的实现方式类似于 C++,因此 C/C++ 编程人员可以轻松掌握 Java。但是,LotusScript 开发人员可能会发现 Java 语法与 LotusScript 大不相同。 由于本文关注的是在 Lotus Domino 中使用 Java,因此所展示的示例也将在Lotus Domino 的环境中实现。 我们从经典的“Hello World”示例开始。在 Domino Designer 中创建新的 Java 代理时,会收到表 1 左栏所示的模板代码。右栏的代码已经进行了修改以适应“Hello World”示例的需要。

Creo原创教程top-down-design

Creo原创教程(十) top-down-design之布局运用,看后人人都能top-down 这是一个布局来控制液压油缸顶升物体的案例,下面就介绍如何创建控制这样的布局 由于布局设计尺寸的更改,导致液压油缸顶升的距离的变动,这个就是从顶向下设计的理念中的一部分。

我们现在的很多人都知道什么是top-down-design,一般人第一印象:“它的作用是自动装配,还没看见它还有什么用途,也不知道怎么用。”殊不知,top-down-design这一设计

理念的实质作用。(反正top-down实现自动装配我不用,还没到用的时候)有人知道他们的区别么? A: top-down-design 从顶向下(从顶级设计到细节零件设计) B: down -top-design 从下到上(反之) 你知道什么使用A,什么时候用B么? A:你是自行设计,自主研发,而且后期更改变动很大,需要用A理念来设计 B:你是仿制,copy别人的东西,而且变动不是很大,需要用B理念来设计。 在用A的过程,可以穿插着用B(在细节部分),但是A为主导,在主要尺寸上必须用A。但是你在前期的投入时间比较多,把一些关系和细节做好了,你会事倍功半的,如果前期没有做好,后期你会以加倍的时间来去做它。 在用B设计的时候,可以穿插着用A,但是一B为主导。 实际上top-down-design涉及到proe的知识相当的多,我们在使用上不一定能用到那么多,或许只用到一小部分。

本人是一俗人,没有那么多华丽的辞藻来编制教程,实实在在,通俗的语言文字来描述top-down-design带来的好处以及如何使用它,手把手教会你。 看见了网上有关很多于top-down的帖子,就没有几个详细介绍关于机械top-down-design 设计理念的,有ptc原版的教程,但是适合2001版本的,一部分人看不懂,还有的介绍的非常的简略,还有很多都是抄袭的帖子,我们野火老大的帖子被别人抄袭了好几个版本,以四连杆机构居多(那个是运动骨架来设计的),由于一部分是E文的,还有一部分介绍的很简单,一般的人可能都看不懂,于是乎Creo今天特地做一个教程,一个关于类似于煤矿地下矿井支撑油缸撑板支撑墙壁的教程,网上就没有关于布局来控制油缸等机械运动的教程,悲剧! Top-down设计理念主要是布局和骨架,关于这两个的含义我这里就不讲了,今天将布局大体描述一下布局,布局类似于我们工程师的一个笔记本,一张草纸,比如说你要绘制一个设备,你得先画出它的外形吧,把整体尺寸先控制好,长、宽、高,好建模,声明布

lotusScript Notes类入门教程

LotusScript Notes 课程指导 欢迎来到 LotusScript 和 Notes 的世界。“LotusScript Notes 课程指导”由三节课程组成,介绍如何在 Notes 中使用 LotusScript 语言。每节课程包括: 1.指导您通过创建和测试的 Script 的一系列步骤。 2.在线式解答 Script。 3.一个挑战,要求您用刚刚学到的知识创建一段新的 Script。 4.一个方案,提供一个可能解决挑战的方案。 每节课程都使您学习到一些 Notes 应用开发的经验,使您完成上一节课程的内 步骤0:准备工作 每节课程都使用一个简单的讨论数据库,现在创建它: 1. 选择“文件”“数据库”“新建”。 2. 在“服务器”选项中,选择“本地”。 3. 输入标题。例如可以输入“学习 LotusScript”。 4. 输入文件名。例如可以输入“LEARNING.NSF”。 5. 如果在列表中没有发现模板,选择模板服务器并且选择一个包含这些模板的服务器。 6. 选择“讨论数据库(R4)”模板。 7. 使“继承未来的设计变化”选项无效。 8. 单击“确定”。 9. 在 Notes 完成创建新数据库时,关闭“关于此数据库”文档。 现在准备开始第一课。 目录:第一课:打印数据库标题 第二课:统计视图中文档的数量 第三课:发送电子邮件消息 第一课:打印数据库标题 第一课指导您用 Script 创建一个按钮,无论何时用户单击此按钮便可以打印出数据库的标题。先创建一个示例的讨论数据库叫做“学习 LotusScript”。然后: 1.创建一个按钮 2.书写一个按钮的 Script ,无论何时用户单击此按钮便可以打印出数据库的标题。 3.编译和测试该 Script。 步骤 A:创建按钮 用户单击按钮时运行 Script,所以首先创建一个按钮。 1. 打开创建好的“学习 LotusScript”数据库。 2. 选择“创建”“讨论主题”在数据库中创建一个新的主题文档。 3. 输入一个简单的文档主题,例如“Scripting in Notes is a joy”。 4. 输入一个分类,例如“Script”。 5. 把光标移动到文档正文域中并选择“创建”“热点”“按钮”。程序员的设计窗格出 现在屏幕底部,同时出现了属性框。 6. 在按钮属性框中,编写按钮的标签,例如“打印标题”,然后单击绿色确认标志保存 它。关闭属性框。 7. 在程序员的设计窗格中,如果该按钮没有被选中,则从定义好的可编程对象中选择“打 印标题”按钮。 8. 选择 Script 可选按钮。 9. 如果按钮事件没被选中的话,从按钮事件列表中选择“Click”。当“Click”事件发 生时,本 Script 将运行。

学习LotusScript

学习LotusScript 学习LotusScript LotusScript对象与类 1.面向对象编程 类是以抽象数据类型为基础的对象行为,抽象数据类型定义了以类型为基础执行所有接口为一个类而定义的所有操作称之为方法。 2.对象 一般可以从两个方面来理解面向对象编程中的对象: ?属性。 ?对象。 3.类 类是从对象中抽象出来,作为对具有相同特征的一组对象的描述。类是一种定义,它描述该类中每个对象共有的属性和方法,类不占用计算机内存。 Notes中的类被分为前端类(front-end)和后端类(back-end)两种。 前端类主要对用户当前正在工作的对象、表示Notes客户机用户界面中的对象进行操作。后端类可以访问和操作任何数据库中的任何文档、视图与文件夹内容、数据库ACL以及外部数据。 7个前端类 ?NotesUIDatabase :代表Notes工作台上打开的数据库 ?NotesUIDocument :用于用户访问当前文档 ?NotesUIView :代表当前的数据库视图 ?NotesUIWorkspace :帮助用户访问Notes当前的工作台 ?Button :代表表单或文档上的操作按钮、热点或按钮 ?Navigator :代表一个导航器上的对象,帮助用户操作浏览器 ?Field :代表表单中的一个域。 23个后端类 ?NotesACL :代表数据库中的所有存取控制列表,通过它用户可以访问和使用数据库中的存取控制列表 ?NotesACLEntry :代表存取控制列表中一个单一的ACL项目,通过它用户可以查询Notes 对象的访问属性 ?NotesAgent :代表一个代理,通过它用户可以运行一个代理或查询代理的属性

Creo原创教程(六) top-down-design之骨架模型 球阀建模举例

creo原创教程(六) top-down-design之骨架模型球阀建模举例 从顶向下设计流程之骨架模型 我们先认识一下什么叫做骨架模型 当使用者在建立大型装配件时,会因零部件过多而难以处理,造成这种困难的原 因可能是彼此间的限制条件相冲突,或者是因为零部件繁杂而忽略了某些小的 地方,也可能是从原始设计时,建立的条件就已经出现错误等诸如此类的原因。 因此,在 Proe中提供了一个骨架模型的功能,允许使用者在加入零件之前,先 设计好每个零件在空间中的静止位置,或者运动时的相对位置的结构图。设计好 结构图后,可以利用结构将每个零件装配上去,以避免不必要的装配限制冲突。 骨架模型不时实体文件,在装配的明细表中也不包括骨架模型,为什么要采用骨 架模型?因为它有以下的优点: 1)集中提供设计数据:骨架模型就是一种.part 文件。在这个.part 文件中, 定义了一些非实体单元,例如参考面、轴线、点、坐标系、曲线和曲面等,勾画 了产品的主要结构、形状和位置等,作为装配的参考和设计零部件的参考。 2)零部件位置自动变更:零部件的装配是以骨架模型中基准作为参考的,因此 零部件的位置会自动跟着骨架模型变化。 3)减少不必要的父子关系:因为设计中要尽可能的参考骨架模型,不去参考其

他的零部件,所以可以减少父子关系。 4)可以任意确定零部件的装配顺序:零部件的装配是以骨架模型作为基准装配 的,而不是依赖其它的零部件为装配基准的,因此可以方便的更改装配顺序。 5)改变参考控制:通过设计信息集中在骨架模型中,零部件设计以骨架作为参 考,可以减少对外部参考的依赖。 骨架模型文件是一种特殊的.part 文件 1)是装配中的第一个文件,并且排在默认参考基准面的前面。 2)自动被排除在工程图之外,工程图不显示骨架模型的内容。 3)可以被排除在BOM表之外。 4)没有重量属性。 默认状态下,每个装配件只能由一格骨架模型,当产品比较复杂时,一个骨架模 型需要包括的信息太多,可以采用多个骨架模型相互配合分工,完成设计信息的 提供和参考。 如果要使用多个骨架模型 多个骨架模型多个骨架模型 多个骨架模型,需要更改 Config.pro 文件的选项 “Multiple_skeletons_allowed”为“yes”。 在装配件中用新建骨架模型的方法创建骨架模型文件,系统才能把它自动识 别为骨架模型。虽然可以像普通的零件那样,通过“文件”→“新建”→ “零 件”命令的方式创建.prt 文件,然后把它当作骨架模型使用,但是系统不能自 动地把它识别为骨架模型,而应当按照如下步骤创建 1)新建一零件,名称任意,调整好基准面基准轴等一些组件需要的参照,全部建立好,保存,这就是骨架原模型。 2)在装配模式下单击(新建元件)按钮,新建零件。 3)元件创建对话框中选择“骨架模型”,名称可以更改,点击复制现有,浏览--找到你 前创建的骨架模型,确定。 骨架模型就被调入组件了,那么如何传递骨架的参照给组件中的零件呢。我们看下实 例操作。 今天我们讲解一下骨架模型,教程有限,为方便距离建立一个简单球阀,零件比较简单,只提供参考、思路。教程正式开始: 1.我们要设计一个球阀,首先得考虑它的外观尺寸,内部结构,内部的细节结构可以 再主模型建立好后做细微的调整,得把零件之间的装配关系确定好. 2.新建一个part文件,建立一些基准面,再建立基准轴,保存,名称任意(非中文和 空格等),我保存为skeleton(骨架的英文)。

LotusScript 代理的基本用法

LotusScript 代理的基本用法 1、FTSearch搜索: Set dc=db.Ftsearch("name",0) '0位置为最大的查询数,0为所有匹配的文件FTSearch必须创建数据库索引Set doc=dc.Getfirstdocument()、 2、Item: Set doc=dc.Getfirstdocument() While Not doc Is Nothing ForAll ritem In doc.Items MsgBox https://www.doczj.com/doc/fb16600118.html, End ForAll Wend 3、取出特定的域 Set doc=view.getFirstdocument() If doc.HashItem("yu") <> "" Then Set item=doc.getfirstitem("yu") Set doc=view.getNextdocument(doc) End If 4、使用文本属性 If doc.Hashitem("yu") <> "" Then Set doc=dc.Getfirstdocument() While Not doc Is Nothing ForAll itemValue In doc.yu itemValue = "Anonymous" End ForAll Set doc=dc.Getnextdocument(doc) Wend End If 5、获取域值: ForAll itemValue In doc.Getitemvalue("yu") 6、添加域 set item =new NotesItem(doc,"newYu",https://www.doczj.com/doc/fb16600118.html,erName) Call doc.Appenditemvalue("newYu",Newvalue) 7、替换值: 1)、While Not doc Is Nothing Call doc.Replaceitemvalue("resName","newValue") Set doc=dc.getnextdocument(doc) Wend 2)、Set doc=dc.Getfirstdocument() While Not doc Is Nothing 'Call doc.Replaceitemvalue("resName","newValue") Set item =doc.Getfirstitem("yu")

Creo原创教程(九),接触碰撞运动仿真解析,引申模具顶针顶出件运动要点

Creo原创教程(九),接触碰撞运动仿真解析,引申模具顶针顶出件运动 今天我们来讲一下接触碰撞运动的仿真(这个恐怕是坛子里对凸轮连接最详细的教程)

之前很多人pm还有在qq群问我说做模具顶出件运动怎么做, 我直接回答用凸轮连接对设置连接,启用升离,再启用重力就可以了,这样还是有很多人不太明白,其这个东西听着很简单,里面还有很多的窍门和方法 再加上一些经验,只要你看过了本教程,再加上平时多联系,相信接触碰撞这里,一般的问题都可以解决了,我们来看一下,以前的2001版本以前方针分 析里面比较简单,简单的方针都可以做到,但是到了野火版本以后,功能提升了好多,在野火中有三种特殊的连接,可以设置特殊连接后进行各种分析, 这三种连接分别为凸轮副连接,槽连接,齿轮运动副连接,今天讲的是接触碰撞的仿真,主要用到的是凸轮的链接,所以只讲凸轮,齿轮和槽连接以后再 讲。 顶针顶出件运动仿真,其实就是在顶针头部和接触的件之间建立一个凸轮连接,有人会问,顶针和件是两个平面与平面相碰,怎么建立凸轮,在凸轮连接 时,里面有一些技巧,尤其是建立曲面和选择曲面时,技巧性比较强,相信很多高手有些时候都那凸轮连接因没有选择好曲面或是没有建立好曲面,导致 仿真多次失败。 我们先看一下凸轮的链接设置

1 “凸轮1”选项卡:定义第一个凸轮 (1)“曲面/曲线”:单击箭头选取曲线或曲面定义凸轮工作面,在选取曲面时若钩选自动 选取复选框则系统自动选取与所选曲面相邻的任何曲面,凸轮与另一凸轮相互作用的 一侧由凸轮的法线方向指示。如果选取开放的曲线或曲面,会出现一个洋红色的箭头, 从相互作用的侧开始延伸,指示凸轮的法向。 选取的曲线或边是直的,“机械设计模块”会提示选取同一主体上的点、顶点、平面实 体表面或基准平面以定义凸轮的工作面。所选的点不能在所选的线上。工作面中会出现 一个洋红色箭头,指凸轮法向。

ACL基础

在Domino中,数据库的存取控制列表是Domino安全性的重要组成部分,也是决定每个用户能否访问数据库的主要设置。每个数据库都有自己的存取控制列表(Access Control List, 以下简称ACL)。打开一个数据库,选择菜单“文件”-“数据库”-“存取控制”,就可以看到该数据库的ACL。 ACL分为四个页面:基本、角色、日志和高级。以下分别说明这四个页面中的内容。并说明了ACL 中可以接受的名称格式。 ACL的“基本”页面 ACL的核心功能都包含在“基本”页面中。在“个人/服务器/工作组”中选择“全部显示”,所有存取级别的用户都会被列出。也可以选择仅查看“管理者”、“设计者”等某个存取级别的用户。当选中某个用户名时,对话框中会显示他的用户类型和存取级别,以及与此存取级别相应的一些扩展和限制选项。用户类型和存取级别指定了用户对此数据库的最大权限。数据库的管理员可以增加、删除或修改用户的权限。 点击看大图 返回 七个存取级别 ACL中共有七个存取级别:管理者、设计者、编辑者、作者、读者、存放者和不能存取者。了解这些级别的含义是了解ACL工作机制的基础。下图显示了每个存取级别的缺省权限,从不能存取

者开始,每个级别都比下一级拥有更多的权限,直到拥有所有权限的管理者。(每个级别的权限 都包含其下所有级别的权限)。 不能存取者 此级别表示用户没有任何权限,不能存取数据库。管理员可以开放给不能存取者的权限只有“读取公用文档”和“写公用文档”。关于公用文档的概念,见下面的“读写公用文档”部分。 存放者和读者 存放者只能向数据库中放入文档,但不能读取这些文档。读者则只能读文档,但不能向数据库中放入文档。二者都只具有单一的功能。(读者拥有一个额外的权限,可以执行代理)。 作者 作者可以创建、修改、删除文档。但是,要想使拥有作者权限的用户能够修改、删除文档,还需要作进一步的设置:要创建文档,需要选中“创建文档”选项。要修改文档,需要设置文档中的作者域。要删除文档,需要选中“删除文档”选项,同时需要设置文档中的作者域。 在设计数据库时,有一类特殊的域称为作者域,这种域的类型是“作者”。在文档中,作者域可以包含用户、群组或角色的名称。如果一个用户在ACL中具有作者权限,同时,他的名字又包含在文档的作者域中,那么,这个用户就是该文档的所有者之一,可以修改此文档。如果用户未被包含在作者域中,则即使此文档是由他创建的,也无权修改它。 作者域只对存取级别为作者的用户起作用。其他的存取级别不受作者域的限制。例如,存取级别为读者的用户,即使名字包含在作者域中,也无权修改文档;存取级别为编辑者以上的用户,不需要包含在作者域中也可以修改数据库中所有文档。 因此,在设计数据库时,如果需要仅允许用户修改库中的一部分文档,则需要加入作者域,以细化用户的权限。 编辑者 编辑者具有更高的存取权限,可以修改数据库中的所有文档。通过各个子选项的设置,还可以赋予编辑者以下权限:删除文档,创建个人代理,创建个人文件夹/视图,创建共享文件夹/视图,创建LotusScript/Java代理。

Creo环境界面配置教程

Creo环境界面配置教程 Creo是PTC公司Pro/Engineer系列软件的最新版本,相比WildFir e版本Creo软件在环境界面上的变动比较大,需要知道的就是新的命令在哪? 在软件界面和配置选项的设定上这次的软件更新可以说做了一些较大的改进和创新、借鉴。下面就通过一些图片和简单的说明来看一下具体的变化吧。 更多Creo原创教程敬请期待。 首先的改变当然是软件的使用界面,这样的命令布局方式也是赶潮流啊! 工具栏变得更充实和紧凑,根据指令的使用频度确定不同的指令位于不同的位置,方便用户的选取。 下面重点看一下常用的配置选项,我认为这是使一个软件符合自己使用习惯的第一步啊。上面提到的新版本的颜色显示确实建加给力了,也许有些人又不习惯了。收藏夹功能则更加人性化。 通过收藏夹,用户可以把自己经常要修改的选项放进去,方便自己的快捷修改。 颜色的默认设置建议不要更改,背景如果你更习惯或喜欢之前版本的也可以自己修改。现在配置选项的保存更方便点了。

模型显示设置的变化不大,但需要注意有几个选项的位置,不要用时找不到。 新的选择过滤器可以自己定制,方便用户根据自己经常使用的过滤选项组合定制,使用过滤项更方便和快捷。 草绘器的约束选项 令人头痛的数据交换选项的配置现在更为直观,各种选项一目了然,用户输入和输出文件不再是一件烦恼事 装配功能提供了更多的可选选项,使用户的装配更具有灵活性 在自定义功能区设定中可以很快知道命令的位置,如下图,对于新版本命令不太熟的情况下很值得参考。 顶部的工具条也可以自己定制,想怎么放就怎么放。 看图吧。没有什么难度的教程,仅供你了解吧。 Creo文件菜单管理功能 这个教程又是很简单的命令,仅供大家参考吧,也许我了解的也只是皮毛而已! 不过目前发现Creo 1.0 F000 使用起来确实还存在一些问题。但对于新的尝试存在问题也是难免的啊。 1、软件很容易非正常退出和死掉,不过退出后再打开会提示是否恢复,但往往恢复也会造成再次退出。

LotusScript语法

第1课 LotusScript语法  1.1 LotusScript的语法:  1.1.1 语法概要:  √ 语句行结束为行结束,无须特殊符号  √ 一条语句占有多行时,使用“ _”作为行结束  √ 同一行录入多条语句时,使用“:”分隔语句  √ 语法类似VB,大小写不敏感  √ 注释:  ? 单行:’  ? 多行:%Rem …%End Rem  √ 基本变量类型赋值:“=”  √ 对象赋值:“Set ObjectName = ”  1.1.2 内置常量:  √ NOTHING:  ? 为Object的默认值  ? 使用Is来判断(不可使用“=”)  √ NULL  ? 使用IsNull()来判断(不可使用“=”)  √ PI  ? 3.1415926…  √ TRUE/FALSE  ? LotusScript内部使用-1代表TRUE;使用0代表FALSE  ? 任何非0数,即为TRUE  √ EMPTY  ? 对String类型:””  ? 对数字类型:0  ? 使用IsEmpty()判断(参见Notes Help)  > 当对NotesItem之Variant值判断时,IsEmpty(Var(0))总返回True,即使域值为””  > 使用Var(0) = “”判断!  ? 该EMPTY名称不可用以赋值!  1.1.3 基本变量类型  √ 数字:  ? 非十进制数  > Byte(1-Byte)  > 2进制:B  ° 如:B10010100, %B10010100  > 8进制:O  ° 如:O711423, &O711423  > 16进制:H  ° 如:H459f, &H459f  ? 整数:  > Integer(2-Byte)

CREO阵列实例(高级篇)

CREO阵列经典实例解析 高级篇 落枫之影(413624704)一.阵列的定义: 通过重复复制、改变某一个(或一组)特征的指定尺寸,根据设定的变化规律和数量,自动生成一系列具有参数相关性的特征(组)。 在CREO软件中,阵列的方式有以下八种: 1.尺寸阵列:需选取特征尺寸,并指定这些尺寸的增量变化以及阵列中特征实体数。 2.方向阵列:需选取平整面、线、轴来定义方向,同时也可以使用特征尺寸增量来控 制阵列实体的形状及位置的变化。 3.轴阵列:通过围绕一个选定的旋转轴(基准轴等)创建特征副本的阵列方式。 4.填充阵列:指定的物体表面或部分表面区域,生成均匀的阵列。 5.表阵列:使用表格的方式设定阵列特征的空间尺寸和本身尺寸。 6.参考阵列:借助已有的阵列实现新阵列的方法,参考阵列操作对象必须与已有阵列 的源实体有定位尺寸关系。 7.曲线阵列;指定阵列成员间距离或成员个数,来沿着草绘曲线创建其阵列特征。 8.点阵列:通过创建基准点或草绘几何点来创建其阵列特征。 温馨提示: 1.阵列特征不能直接使用【删除】命令来删除,因为这样会连你的原始特征也一 起删掉,如果要保留原始特征,请使用【删除阵列】命令来删除 2.阵列预览中的黑点代表要进行阵列的位置,单击黑点将其变成白点,表示此位 置不需要阵列。 3.若阵列的特征有多个,需将这些特征编组,然后再进行阵列

二.CREO软件阵列操作界面 三.需要使用关系来控制阵列时,你会用到以下符号: memb_v-指定方向中的关系驱动最终尺寸 memb_i-指定方向中的关系驱动增量 lead_v-leader值(选择尺寸确定方向) idx1-阵列实例索引在第一方向(代表当前实例特征在阵列中的位置,其值从0开始,第一方向第一个实例特征idx1=0,第五个实例特征idx1=4)idx2-阵列实例索引在第二方向(同上,只是方向不同而已) 不能在同一关系中使用memb_v和memb_i,这些符号所代表的含义我将会在下面的这些实例中详细说明。

Domino ACL权限设置详解

Domino中,数据库的存取控制列表是Domino安全性的重要组成部分,也是决定每个用户 能否访问数据库的主要设置。本文详述了存取控制列表的各项设置,以帮助用户更好地理解并 使用数据库的ACL。 ACL的“基本”页面 ACL的“角色”页面 ACL的“日志”页面 ACL的“高级”页面 存取控制列表(ACL) 中可接受的名称 正文在Domino中,数据库的存取控制列表是Domino安全性的重 要组成部分,也是决定每个用户能否访问数据库的主要设置。 每个数据库都有自己的存取控制列表(Access Control List, 以下简称ACL)。打开一个数据库,选择菜单“文件”-“数据 库”-“存取控制”,就可以看到该数据库的ACL。 ACL分为四个页面:基本、角色、日志和高级。以下分别说明 这四个页面中的内容。并说明了ACL中可以接受的名称格式。 ACL的“基本”页面 ACL的核心功能都包含在“基本”页面中。在“个人/服务器/工作 组”中选择“全部显示”,所有存取级别的用户都会被列出。也可 以选择仅查看“管理者”、“设计者”等某个存取级别的用户。当选 中某个用户名时,对话框中会显示他的用户类型和存取级别, 以及与此存取级别相应的一些扩展和限制选项。用户类型和存 取级别指定了用户对此数据库的最大权限。数据库的管理员可 以增加、删除或修改用户的权限。 点击看大图

返回 七个存取级别 ACL中共有七个存取级别:管理者、设计者、编辑者、作者、读者、存放者和不能存取者。了解这些级别的含义是了解ACL 工作机制的基础。下图显示了每个存取级别的缺省权限,从不能存取者开始,每个级别都比下一级拥有更多的权限,直到拥有所有权限的管理者。(每个级别的权限都包含其下所有级别 的权限)。 不能存取者 此级别表示用户没有任何权限,不能存取数据库。管理员可以开放给不能存取者的权限只有“读取公用文档”和“写公用文档”。关于公用文档的概念,见下面的“读写公用文档”部分。 存放者和读者 存放者只能向数据库中放入文档,但不能读取这些文档。读者则只能读文档,但不能向数据库中放入文档。二者都只具有单一的功能。(读者拥有一个额外的权限,可以执行代理)。 作者 作者可以创建、修改、删除文档。但是,要想使拥有作者权限的用户能够修改、删除文档,还需要作进一步的设置:要创建文档,需要选中“创建文档”选项。要修改文档,需要设置文档中的作者域。要删除文档,需要选中“删除文档”选项,同时需要设置文档中的作者域。

creo原创教程三液压管路布局proe高级应用之管道设计精编版

c r e o原创教程三液压管 路布局p r o e高级应用 之管道设计 公司内部编号:(GOOD-TMMT-MMUT-UUPTY-UUYY-DTTI-9018)

c r e o原创教程(三),液压管路布局p r o e高级应用之管道设计今天creo给大家带来高级应用的管道设计,昨天发布的曲面展平和实体自由形状,希望大家能够支持,其中曲面展平教程已经被加入到精华帖,好高兴,种子终于结果了,希望大家错支持,多回复,您的回复是我继续发好贴的动力。 管道设计一般情况下我都用sweep (走管布局简单的),稍微复杂点的就得vss或sweep blend,还有很多用管道设计模块。建立点,根据点建立曲线,复制合并成一条曲线,然后再vss或sweep blend 这个完全可以,个人感觉常规办法都是这样,我以前也是这样做的,今天给大家做个插入-高级引用的管道设计,相信你看后一定会会经常用到这个的。管道设计模块我没有用过,如果大家有异议,可以发帖共同交流 1.我先建立几个障碍,走管绕过这些障碍. 2.建立几个基准面,再建立点,这些点要穿过障碍,不能在每个障碍上,基准面要建立点适当看图,这些基准面和点的建立有一定的经验成分在里面,不过不用担心,即使你现在的面和电建立的 不 好,到时候可以调整

3.点击插入--高级--管道,弹出菜单管理器,这里用默认的就可以,几何就是点线面,空心,你的 管 道不可能是实心对吧,常数半径,这个可以随意一些,到时候和障碍有冲突,可以设置多重半径, 一 般情况下我都设置为常数,点完成,输入外部直径我输入10,管道壁厚为 1.5,添加点,根据你 的 管道的走向顺次选取点,别忘了按住ctrl键,到拐弯的时候让你输入折弯半径,这个也有一定的经 验 在里面,一次不行可多次,一步一步来,点选每个点后,出现个箭头,箭头的方向代表该点所在曲 线 曲率的方向,也就是切线的方向,选择完最后一个点,点击鼠标中间,可以看到管路建立好了。如果觉得不满意,可以再调整一下点,教程管道的设计比较简单,实际情况比这个复杂的也有很多, 这里只提供思路,做管道设计,尤其是液压系统的设计,建议用这个种方法,比较好控制,如果vss或者sweep blend,单单是合并曲线就够你忙活一会了,有人会问,为什么sweep不行么,我可以告诉你,合并的复杂曲线sweep是扫描不到的,这里就不能用sweep,简单的在一个平面内的简

lotusscript基本语法

LotusScript基本语法 LotusScript语言的基本知识 一、概述 LotusScript是一种和Basic相兼容的面向对象的Scripting环境,它具有强大的能够从 事面向对象应用软件开发的语言范围,能够提供循环和分支的能力、数组以及访问Notes对象的能力。 判断Notes中什么时候使用LotusScript或公式语言 1)任何时候当执行该任务的函数或命令存在时,使用公式。 2)对于复杂的程序控制或循环,使用LotusScript。 3)存取或操作储存的文档数据要使用LotusScript,特别对于跨文档、跨数据库的存取。 4)若公式语言不能办到,则使用LotusScript 在Notes应用程序中访问和操作对象需要三步进行: 1.声明对象变量DIM DIM db As NotesDatabase 2.实例化一个类将其赋值给对象变量 SET db = New NotesDatabase("Domestic","Sales.nsf") 3.使用这个对象的方法或属性 db.created '用来展现创建数据库时的日期和时间

二、NotesScript中的数据元素 NotesScript中的常量 Null '特殊值,代表数据遗失或空 Empty '相当于"",也就是空串 Nothing '涉及变量的初始值,表示对象变量没有内容 PI '圆周率 True/False '分别为数值1和0 数据类型 Integer(整型) Long(长整型) Single(单精度型) Double(双精度型) Currency(货币型) String(字符串) 运算符 + - * / < > <> = Not And OR & 常量和变量 Dim address As String '定义变量 address = "100 Main Street " '变量赋值

PTC-Creo-快速入门教程

Creo 实际操作研讨会

欢迎 欢迎加入 Creo 实际操作研讨会!完成本工作手册的全部课程后,您将体会到 Creo Parametric 在设计 SAE 方程式赛车时的快速性和易用性。 这些课程分为概念设计、细节设计和几个可选的练习。在某些情况下,您还有机会选择您最感兴趣的课程,例如,您可以从概念设计的三个练习中选择一个您最感兴趣的练习。我们已为您选择了以下课程,目的在于最大程度提高您对 Creo Parametric 的现场操作时间,同时重点演示对您而言最为重要的多项功能以及一些引人注目的新颖之处。 现在开始!

目录 欢迎 (2) 用户界面 (3) 概念设计 (选择一个) Creo Sketch 和自由式概念设计 (7) 自由式概念设计 (12) 优化的设计 (26) 2D 概念设计 (36) 细节设计 芯零件建模 (55) 轻量化图形 (71) 装配 (74) 后期设计更改 (83) 第三方数据导入 (89) 可选模块 钣金件设计 (91) 模拟 (111)

惯例 ?菜单命令以粗体显示 ?逗号字符,用作命令之间的分隔符 ?图标显示与命令文本一致 ?键盘键以粗体CAPS显示 ?鼠标左键、鼠标中键和鼠标右键单击分别称为LMB、MMB和RMB

用户界面 区用户界面与常用桌面产品类似。这对于分组任务和最小化鼠标行 程很有帮助。您还将体验集成的 LearningConnector,获得即时上下 文相关帮助和视频教程。

本课程教授的内容 在构建排气头的过程中,您将熟悉 Creo Parametric 中新的用户界面 (UI)。命令搜索实用工具和 LearningConnector 可帮助您找到本练习中使用的常用命令和高级命令,正是凭借这些命令,Creo Parametric 成为了现今市场中领先的参数建模工具。 现在打开现有的赛车设计。 1.“文件”(File),“打开”(Open) Creo HOW,FormulaSAE文件夹,选择 1_PTC_full_assembly.asm,“打开”(Open)

相关主题
文本预览
相关文档 最新文档