.NET

Reply
Contributor
troymoore7595
Posts: 23
Registered: ‎10-14-2008
Message 1 of 3 (329 Views)

Typed Value - Polyline

329 Views, 2 Replies
05-30-2012 06:01 AM

I am looking for the correct TypedValue to get only polylines. Any ideas

 

 

PublicSub WATakeoff()

       

Dim myDocument AsDocument = DocumentManager.MdiActiveDocument

       

Dim myDB AsDatabase = HostApplicationServices.WorkingDatabase   ' Database of Drawing

       

Dim myEd AsEditor = myDocument.Editor

       

Using myTrans AsTransaction = myDocument.TransactionManager.StartTransaction

           

Dim myTVs(1) AsTypedValue

            myTVs(0) = NewTypedValue(DxfCode.LayerName, "T-STRIP-WHITE")

            HERE IS MY PROBLEM : myTVs(1) = NewTypedValue(Poly2dType.SimplePoly)

           

Dim myFilter AsNewSelectionFilter(myTVs)

           

Dim myPSR AsPromptSelectionResult = myEd.GetSelection(myFilter)

            MsgBox(myPSR.Value.Count)

           

If IsNothing(myPSR.Value) = TrueThen

                myTrans.Abort()

               

Exit Sub

           

EndIf

           

If IsNothing(myPSR.Value) = FalseThen

               

Dim myss AsSelectionSet = myPSR.Value

               

ForEach mySelObj AsSelectedObjectIn myss

                   

ForEach myObjID AsObjectIdIn myPSR.Value.GetObjectIds

                       

If myObjID.ObjectClass.DxfName = "LWPOLYLINE"Then

                            MsgBox(myObjID.ObjectClass.DxfName & vbCr & myObjID.ObjectClass.Name)

                            Autodesk.Civil.QTO.DatabaseServices.

QTOUtility.AddPayItemId(myObjID, "6472120")

                       

EndIf

                   

Next

               

Next

           

EndIf

            myTrans.Commit()

       

EndUsing

   

EndSub

Troy Moore
Civil3D 2014
Windows 7 Pro, 64 bit
Intel Xeon E31225 @ 3.40Ghz
16 GB RAM
Valued Contributor
Paulio
Posts: 82
Registered: ‎06-26-2008
Message 2 of 3 (325 Views)

Re: Typed Value - Polyline

05-30-2012 06:24 AM in reply to: troymoore7595

Hi Troymoore,

 

try this:

 

  myTVs(1) = NewTypedValue(DXFCode.Start,"LWPOLYLINE")

Contributor
troymoore7595
Posts: 23
Registered: ‎10-14-2008
Message 3 of 3 (323 Views)

Re: Typed Value - Polyline

05-30-2012 06:26 AM in reply to: Paulio

Thanks. I knew it was something simple, but I needed more coffee.

Troy Moore
Civil3D 2014
Windows 7 Pro, 64 bit
Intel Xeon E31225 @ 3.40Ghz
16 GB RAM
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!