.NET

Reply
Active Contributor
chase.hochstrasser
Posts: 42
Registered: ‎07-17-2013
Message 1 of 3 (178 Views)
Accepted Solution

Query report text

178 Views, 2 Replies
12-19-2013 12:17 PM

I would like to create a text file with from a report. here is my code so far....

 

                    '' Clear the existing Query
                    Dim qryModel As QueryModel = proj.CreateQuery()
                    qryModel.Clear()

                    Dim qryBranch As New QueryBranch(Constants.JoinOperator.OperatorAnd)

                    '' Property Condition
                    Dim propertyCondition As PropertyCondition = New PropertyCondition
                    propertyCondition.JoinOperator = Constants.JoinOperator.OperatorAnd
                    propertyCondition.PropertyType = Constants.PropertyType.Layer
                    propertyCondition.ConditionOperator = Constants.ConditionOperator.ConditionEqual
                    propertyCondition.Value = "CP*"
                    qryBranch.AppendOperand(propertyCondition)
                    qryModel.Define(qryBranch)
                    qryModel.Mode = Constants.QueryType.QueryReport
                    qryModel.ReportTemplate.AddLine(":CIRCUIT@CIRCUIT")
                    qryModel.ReportTemplate.AddLine(".DWGNAME")
                    qryModel.Execute(dwgSet)
                    qryModel.Run()

 can you help me to send data to a text file?

Hi,

 

is that the line you are missing (based on your code):

 

      'last lines based on your code (after adding .DWGNAME):

      'define your output file

      qryModel.ReportTemplate.FileName = "C:\TEMP\ReportResult.TXT"

      'removed ... qryModel.Execute(dwgSet)

      qryModel.Run()

 

- alfred -

*Expert Elite*
Alfred.NESWADBA
Posts: 9,207
Registered: ‎06-29-2007
Message 2 of 3 (143 Views)

Re: Query report text

12-20-2013 01:22 AM in reply to: chase.hochstrasser

Hi,

 

is that the line you are missing (based on your code):

 

      'last lines based on your code (after adding .DWGNAME):

      'define your output file

      qryModel.ReportTemplate.FileName = "C:\TEMP\ReportResult.TXT"

      'removed ... qryModel.Execute(dwgSet)

      qryModel.Run()

 

- alfred -

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
Active Contributor
chase.hochstrasser
Posts: 42
Registered: ‎07-17-2013
Message 3 of 3 (123 Views)

Re: Query report text

12-20-2013 08:30 AM in reply to: chase.hochstrasser

Correct! Thanks again.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.