.NET

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

Typed Value - Polyline

340 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 (336 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: 24
Registered: ‎10-14-2008
Message 3 of 3 (334 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.