.NET

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

Query report text

182 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,417
Registered: ‎06-29-2007
Message 2 of 3 (147 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 (127 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
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!