Community
Civil 3D Customization
Welcome to Autodesk’s AutoCAD Civil 3D Forums. Share your knowledge, ask questions, and explore popular AutoCAD Civil 3D Customization topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

civil 3d vb.net extended data tab of the properties window

10 REPLIES 10
Reply
Message 1 of 11
kcimos
3085 Views, 10 Replies

civil 3d vb.net extended data tab of the properties window

I'm duplicating my thread here, but this one should focus on the .net aspects of this topic.

 

I'm using civil 3d 2014.

 

If one enters the "propertysetdefine" command or "stylemanager" command, a window pops up that lets you define properties for objects. You can then add these properties via the Extended Data tab of the Properties window.

 

I ultimately want to automate the process of entering this data once these properties exist, and also possibly adding the properties to begin with.

 

My searches have only gotten me to info about editing the civil 3d parts catalog, or stuff for ADA & MEP. I saw a nice article about being able to edit the Notes Property field which is in the extended data tab by default. But this will not suffice, due to client expectations.

 

10 REPLIES 10
Message 2 of 11
rl_jackson
in reply to: kcimos

I'll watch here too.

Rick Jackson
Survey CAD Technician VI

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

Message 3 of 11
kcimos
in reply to: rl_jackson

It was suggested that I'm looking for exteded entity data, I found this code:

 

    <CommandMethod("VXD")> _
    Public Sub ViewXData()
        ' Get the current database and start a transaction
        Dim acCurDb As Autodesk.AutoCAD.DatabaseServices.Database
        acCurDb = Application.DocumentManager.MdiActiveDocument.Database

        Dim acDoc As Document = Application.DocumentManager.MdiActiveDocument

        Dim appName As String = "MY_APP"
        Dim msgstr As String = ""

        Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()

            ' Request objects to be selected in the drawing area
            Dim acSSPrompt As PromptSelectionResult = acDoc.Editor.GetSelection()

            ' If the prompt status is OK, objects were selected
            If acSSPrompt.Status = PromptStatus.OK Then

                Dim acSSet As SelectionSet = acSSPrompt.Value

                ' Step through the objects in the selection set
                For Each acSSObj As SelectedObject In acSSet
                    ' Open the selected object for read
                    Dim acEnt As Entity = acTrans.GetObject(acSSObj.ObjectId, _
                                                            OpenMode.ForRead)

                    ' Get the extended data attached to each object for MY_APP
                    Dim rb As ResultBuffer = acEnt.GetXDataForApplication(appName)

                    ' Make sure the Xdata is not empty
                    If Not IsNothing(rb) Then
                        ' Get the values in the xdata
                        For Each typeVal As TypedValue In rb
                            msgstr = msgstr & vbCrLf & typeVal.TypeCode.ToString() & ":" & typeVal.Value
                        Next
                    Else
                        msgstr = "NONE"
                    End If

                    ' Display the values returned
                    MsgBox(appName & " xdata on " & VarType(acEnt).ToString() & ":" & vbCrLf & msgstr)

                    msgstr = ""
                Next
            End If

            ' Ends the transaction and ensures any changes made are ignored
            acTrans.Abort()

            ' Dispose of the transaction
        End Using
    End Sub

 but this does not retrieve any properties that were created via propertsetdefine and assigned via the extended data tab of the properties window.

Message 4 of 11
Jeff_M
in reply to: kcimos

Looks like the propertyies you are looking for are Aec Dictionary objects. Here's a snip from the Object Browser for the AecBaseMgd.

8-8-2014 2-43-13 PM.png

 

Hope that gets you a starting point!

I'm curious as to how this will be (or is, if you are using it manually) used. What kind of information do you add to display there? 

Jeff_M, also a frequent Swamper
EESignature
Message 5 of 11
kcimos
in reply to: Jeff_M

our client has guidelines for civil3d files. In addition to normal pipe and structure data, they want various names,IDs,Owners, etc for each part (& other things too), They lay out the procedure to set up the drawing using Propertysetdefine, otherwise I'd have looked into doing it differently by now. There are scores of drawings, with thousands of pipes/structures, and potential for future projects, so automation makes sense.
Message 6 of 11
kcimos
in reply to: kcimos

thanks, I'll lookinto RXObject

Message 7 of 11
Jeff_M
in reply to: kcimos

No, not the RXObject, that is the base AutoCAD object class. I was referring to the Dictuonary* objects. However, that isn't right anyway. If you add a reference to the AecPropDataMgd.dll, I think you will find everything in there you need. I'm looking now, but running out of time to do any testing.

Jeff_M, also a frequent Swamper
EESignature
Message 8 of 11
Jeff_M
in reply to: Jeff_M

I found some sample code over at theSwamp that should help:

http://www.theswamp.org/index.php?topic=37862.msg430653#msg430653

http://www.theswamp.org/index.php?topic=43114.msg510122#msg510122

http://www.theswamp.org/index.php?topic=40079.msg453458#msg453458

 

There are also a few references in the AutoCAD Architecture Customization forum: http://forums.autodesk.com/t5/AutoCAD-Architecture/bd-p/54

 

Good Luck!

Jeff_M, also a frequent Swamper
EESignature
Message 9 of 11
kcimos
in reply to: Jeff_M

thanks for the help, However I don't think AecPropDataMgd.dll is a civil 3d thing. I can't check until Monday.
Message 10 of 11
Jeff_M
in reply to: kcimos

Yes, it is. I was able to do some rudimentary stuff in the half hour I spent with it.
Jeff_M, also a frequent Swamper
EESignature
Message 11 of 11
kcimos
in reply to: Jeff_M

Great, Thanks a lot.

I had seen these examples while searching, but since they were in architecture and/or MEP forums, and there was the whole Space object part, I continued to look elsewhere, without knowing that I was on the right track.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Rail Community


 

Autodesk Design & Make Report