• 易迪拓培训,专注于微波、射频、天线设计工程师的培养
首页 > HFSS > HFSS help > Document Generator Interfaces

HFSS15: Document Generator Interfaces

录入:edatop.com     点击:

This document briefly describes the API interfaces available in the document generator plugin.

(Ansys.Ansoft.DocGeneratorPluginDotNet.dll)

Scripting objects available in the script for the Generate function

• oApp = self.GetUDDAppContext(

Gets the application context

Usage:- Gets the active project ad the version of the product

oDesktop = oApp.GetAppDesktop()

if oDesktop != None:

vr = oDesktop.GetVersion()

oProject = oDesktop.GetActiveProject()

 

• oDesign = self.GetUDDDesignContext()

Gets the design context

Usage:- Gets the design name.

oDesign = self.GetUDDDesignContext()

if oDesign != None:

nm = oDesign.GetName()

 

• IUDDGenerator interface

This interface available in the Generate method of the UDDPluginExtension.

This interface can be used to

1. Set the document output file path.

docgen.SetOutput("C:\Examples\DocumentOutput.xml")

 

2. Get the document root.

docroot = docgen.GetDocumentRoot()

 

3. Write out to the output file.

docgen.Write()

 

4. Write Html document

void WriteHTML();

 

5. Write PDF document

void WritePDF();

6. Load the Html transform object

void LoadHTMLTransform();

 

7. Load the cached PDF transform object

void LoadPDFTransform();

 

8. Get script path

string GetScriptPath();

 

9. Get output file path

string GetOutputFilePath();

 

• IUDDRoot interface

Calling GetDocumentRoot() on the IUDDGenerator interface provides you with the this interface. This interface can be used to

1. Add a new section to the document. Provide a section title.

section1 = docroot.AddSection("Section title")

 

2. Add a new section to the document. Provide a section title and subtitle

section1 = docroot.AddSection("Section title", “Section subtitle”)

 

3. Add a new title

section1 = docroot.AddTitle("Title")

 

4. Add a new subtitle

section1 = docroot.AddSubtitle("Subtitle”)

 

• IUDDSection interface

Calling AddSection() on the IUDDRoot interface provides you with the this interface. This interface can be used to

1. Set an ID for the section for internal links.

section1.SetID("id")

 

2. Add a new table to the document. Provide a table title.

table1 = section1.AddTable("Table title")

 

3. Add a new image to the document. Provide an image title and a file path to the image file.

image1 = section1.AddImage("Image title")

 

4. Add text to the document.

text1 = section1.AddText("Random text........")

 

• IUDDImage interface

Calling AddImage() on the IUDDSection interface provides you with the this interface. On this interface you can call the following methods

1. Set an ID for the image for internal links.

image1.SetID("id")

 

2. Set alignment information . can be "center", "left" and "right".

image1.SetAligment("center")

 

3. Set the file path of the image file. Not necessary if image file path is set through the AddImage() method

image1.SetFileRef("Image path")

 

4. Set the format of the image file. Can be "BMP", "PNG", "JPEG", "JPG", "DVI" etc.. Not sure about the necessity of this one.

image1.SetFormat("format")

 

• IUDDText interface

Calling AddText() on the IUDDSection interface provides you with the this interface. On this interface you can call the following methods

1. Set an ID for the text for internal links.

text1.SetID("id")

 

2. Set the emphasis attribute on the text

text1.SetEmphasis()

 

3. Set the quotes attribute on the text

Text1.SetQuotes()

 

4. Set the block quotes attribute on the text

text1.SetBlockquotes()

 

5. Set quotes on the text

Text1.SetQuotes()

 

6. Set the wordsize attribute on the text

text1.SetSize(size as an integer)

 

7. Set a link to an ID of any element to provide internal links

text1.SetLink("linkname")

 

8. Set an event link to handle an event. The HandleUDDEvents method should be implemented in the script to handle the event.

text1.SetEventLink("linkname")

• IUDDTable interface

Calling AddTable() on the IUDDSection interface provides you with the this interface. On this interface you can call the following methods

1. Set an ID for the table for internal links.

table1.SetID("id")

 

2. Set alignment information . can be "center", "left" and "right".

table1.SetAlignment("center")

 

3. Set the background color of the table

table1.SetBgColor(string bgcolor)

 

4. Set the frame type. Can be "all", "bottom", "top,", "sides", "topbot"

table1.SetFrame(string frame)

 

5. Add a table group and specify the number of columns. A table can have multiple table groups.

IUDDTableGroup table1.SetTableGroup(int columns)

 

• IUDDTableGroup interface

Calling AddTableGroup() on the IUDDTable interface provides you with the this interface. On this interface you can call the following methods

1. Set an ID for the table group for internal links.

tgroup1.SetID("id")

 

2. Set alignment information . can be "center", "left" and "right".

tgroup1.SetAlignment("center")

 

3. Set the column width of a column given the index of the column and the required width. Width can be set in 2 ways.

• Width can be set relative to 1. E.g Setting it to "2*" makes the column width double the width of the others.

• If the entire table width is considered to be 99.99 units. Width can be a number relative to this.

tgroup1.SetColumnWidth(int index, string width)

 

4. Add a header to the table group

IUDDTableRow tgroup1.AddHeader()

 

5. Add a header with multiple rows to the table group. Takes number of sub rows.

IUDDTableRow tgroup1.AddHeader(int rows)

 

6. Add a row of content to the table group

IUDDTableRow tgroup1.AddContent()

 

7. Add content with multiple rows to the table group. Takes number of sub rows.

IUDDTableRow tgroup1.AddContent(int rows)

 

• IUDDTableRow interface

Calling AddHeader() & AddContent() on the IUDDTableGroup interface provides you with the this interface. On this interface you can call the following methods

1. Set an ID for the table row for internal links.

trow1.SetID("id")

 

2. Set alignment information . can be "center", "left" and "right".

trow1.SetAlignment("center")

 

3. Set cell text. Can be cell content or header text. Takes a column index and a text string. It is added to the first row.

IUDDTextElement trow1.Add(int column, string text)

 

4. Set cell text. Can be cell content or header text. Takes a column index, row index and a text string. Takes in a row number because a table row can have multiple sub rows.

IUDDTextElement trow1.Add(int column, int subrow, string text)

 

5. Set cell content. Takes a column index and an int value. It is added to the first row.

IUDDTextElement trow1.Add(int column, int value)

 

6. Set cell content. Takes a column index, row index and a int value.

IUDDTextElement trow1.Add(int column, int subrow, string text)

 

7. Set cell text. Takes a column index and a double value. It is added to the first row.

IUDDTextElement trow1.Add(int column, double value)

 

8. Set cell text. Takes a column index, row index and a double value.

IUDDTextElement trow1.Add(int column, int subrow, double value)

 

9. Set cell text spanning 2 columns. Can be cell content or header text. Takes a sub row index , starting column index., ending column index and a text string.

IUDDTextElement trow1.AddSpanningcolumnst(int subrow, int columnstart, int columnend, string text)

 

10. Set cell text. Can be cell content or header text. Takes a column index, starting sub row index, ending sub row index and a text string.

IUDDTextElement trow1.AddpanningRows(int column, int subrowstart, int subrowend, string text)

 

• IUDDTableRow interface

Calling Add() on the IUDDTableGroup interface provides you with the this interface. On this interface you can call the following methods

1. Set an ID for the table row for internal links.

trow1.SetID("id")

 

2. Set alignment information . can be "center", "left" and "right".

trow1.SetAlignment("center")

Includes all the methods exposed by the IUDDText interface.

 

HFSS 学习培训课程套装,专家讲解,视频教学,帮助您全面系统地学习掌握HFSS

上一篇:Drawing a Rectangle
下一篇:Drawing a Cone

HFSS视频培训课程推荐详情>>
HFSS教程推荐

  网站地图