.NET

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

Typed Value - Polyline

290 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 (286 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 (284 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

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community