.NET

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

Typed Value - Polyline

259 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
Posts: 82
Registered: ‎06-26-2008
Message 2 of 3 (255 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
Posts: 23
Registered: ‎10-14-2008
Message 3 of 3 (253 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 interested in helping shape the Autodesk Community?
We’re looking at a few different ways to improve the “All Forums” landing page and need your feedback! If interested, please take a few minutes to fill out the following Usability Study. Thank you for your time!

Need installation help?

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

Ask the Community