<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: vb.net 2012 (cogo) point styles in Civil 3D Customization Forum</title>
    <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657848#M19385</link>
    <description>&lt;P&gt;OK, I figured that out, I had to go bask to the PointEntity object&lt;/P&gt;</description>
    <pubDate>Fri, 12 Oct 2012 18:28:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-10-12T18:28:44Z</dc:date>
    <item>
      <title>vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3656628#M19380</link>
      <description>&lt;P&gt;all I want to do is get the point style from a user selected COGO point (&amp;amp; then later set it to a different one). This point might be selected along with lines, blocks, and/or whatever. I can get to where I'm dealing with the POINTENTITYobject but one can't access the style from that (or can we?). From what I gather I need to set am AECCPOINT variable from the pointentity object, using the pointentity number property as an index for the aeccpointS index method. THing is, I can't get the AECCPOINTS collection. with is a part of the civil database.&lt;/P&gt;&lt;P&gt;after much research I have the following relevent code:&lt;/P&gt;&lt;PRE&gt;    Dim PtNumber As Double
    Dim ePoint As PointEntity
    Dim aPoint As AeccPoint
    Dim aPoints As AeccPoints
    Dim aPointsIds As ObjectIdCollection&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;    Private m_oAeccDb As IAeccDatabase


    &amp;lt;CommandMethod("CDE")&amp;gt; _
    Public Sub ChangeToDemoCivil()        'this is the civil3d version, which works on COGO point styles too










        ACF.SsGetStuff("Select objects to be placed onto DEMO layers:")

        Dim idArray As ObjectId() = ACF.ssResult.GetObjectIds()

        For Each id As ObjectId In idArray

            Using acTrans As Transaction = ACF.Db.TransactionManager.StartTransaction()


                Try

                    ePoint = CType(acTrans.GetObject(id, OpenMode.ForWrite), PointEntity)


                    If Not ePoint Is Nothing Then        'it is a cogo point, so change to appropriate demo style

                        PtNumber = ePoint.PointNumber


                        aPoints = m_oAeccDb.Points&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;ACF.getstuff () is an external funtion that&amp;nbsp;stores a list of objectids of selected objects in&amp;nbsp; ACF.ssResult (as &lt;FONT size="2" face="Consolas"&gt;&lt;FONT size="2" face="Consolas"&gt;Autodesk.AutoCAD.EditorInput.SelectionSet&lt;/FONT&gt;&lt;/FONT&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am getting a fatal error on this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;aPoints = m_oAeccDb.Points&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Oct 2012 23:38:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3656628#M19380</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-11T23:38:47Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3656724#M19382</link>
      <description>&lt;P&gt;You don't need to go about it in that fashion. See if this helps:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;            Dim ss() As ObjectId = ssResult.Value.GetObjectIds()
            Dim ptEnt As PointEntity
            Using tr As Transaction = doc.Database.TransactionManager.StartTransaction()
                For Each objId As ObjectId In ss
                    ptEnt = objId.GetObject(OpenMode.ForRead, False)
                    Dim ptObj As AeccLandLib.AeccPoint = ptEnt.AcadObject
                    Dim ptStyle As AeccLandLib.AeccPointStyle = ptObj.Style
                    doc.Editor.WriteMessage("Name of the selected point's syle is: " + ptStyle.Name)
                Next
            End Using
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 02:56:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3656724#M19382</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2012-10-12T02:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657242#M19383</link>
      <description>&lt;P&gt;"Dim ptObj As AeccLandLib.AeccPoint = ptEnt.AcadObject"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that was the key bit of info I needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I never would have thouht that a PointEntity had AcadObject property which had a Style property. Now I can look into this aspect of the civil 3d object model, and probably gain enlightenment to other bizarre things.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 12:40:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657242#M19383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T12:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657842#M19384</link>
      <description>&lt;P&gt;OK, now how can I access the point's label style?&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 18:27:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657842#M19384</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T18:27:45Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657848#M19385</link>
      <description>&lt;P&gt;OK, I figured that out, I had to go bask to the PointEntity object&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 18:28:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657848#M19385</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T18:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657868#M19386</link>
      <description>&lt;P&gt;opps sorry, its under PointEntity.AcadObject&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 18:45:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3657868#M19386</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T18:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658146#M19387</link>
      <description>&lt;P&gt;OK, now I'm trying work out how to test if a point style exists.&lt;/P&gt;&lt;P&gt;All I can find is a similar method that was causing my initial post, for getting the pointstyles from the document this time, which crashes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking at the civil3d 2012 developers guide's section on COM&lt;/P&gt;&lt;P&gt;&amp;amp; so to try to retrofit my code to fit with their examples, I add this:&lt;/P&gt;&lt;PRE&gt;Dim oAcadApp As AcadApplication
Set oAcadApp = ThisDrawing.Application
' Specify the COM name of the object we want to access.
' Note that this always accesses the most recent version
' of AutoCAD Civil 3D installed.
Const sCivilAppName = "AeccXUiLand.AeccApplication.6.0"
Dim oCivilApp As AeccApplication
Set oCivilApp = oAcadApp.GetInterfaceObject(sCivilAppName)
 
' Now we can use the AeccApplication object.
' Get the AeccDocument representing the currently
' active drawing.
Dim oDocument As AeccDocument
Set oDocument = oCivilApp.ActiveDocument
' Set the viewport of the current drawing so that all
' drawing elements are visible.
oCivilApp.ZoomExtents&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;amp; the first error is that acadapplication is ambigous in the autodesk.autocad.interop&lt;/P&gt;&lt;P&gt;then I see that they are using "THISDRAWING" &amp;amp; "SET". so this documentation for COM is based on VBA, which makes sense, except VB.NET is what the guide is about.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so, anyone know of any way to test if a (point) style exists?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(anyway of copying or saving as one too?)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 21:40:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658146#M19387</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T21:40:46Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658182#M19388</link>
      <description>&lt;P&gt;I prefer to stay with the .NET API when possible. This will check if a PointStyle exists. Use the same idea for other styles.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;    Function PointStyleExists(ByVal civDoc As CivilDocument, ByVal name As String) As Boolean
        Dim exists As Boolean = False
        Dim styles As PointStyleCollection = civDoc.Styles.PointStyles
        Try
            Dim id As ObjectId = styles(name)
            exists = True
        Catch ex As ArgumentException
        End Try
        PointStyleExists = exists
    End Function&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Or, depending on what you need it for, have it return the ObjectId if you need that.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 22:17:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658182#M19388</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2012-10-12T22:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658226#M19389</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(anyway of copying or saving as one too?)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not sure I understand this question.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 23:07:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658226#M19389</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2012-10-12T23:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658236#M19390</link>
      <description>&lt;P&gt;Here's how to test for the existence of a PointLabelStyle:&lt;/P&gt;
&lt;PRE&gt;    Function PointLabelStyleExists(ByVal civDoc As CivilDocument, ByVal name As String) As Boolean
        PointLabelStyleExists = False
        Dim styles As Autodesk.Civil.DatabaseServices.Styles.LabelStyleCollection = civDoc.Styles.LabelStyles.PointLabelStyles.LabelStyles
        Try
            Dim id As ObjectId = styles(name)
            PointLabelStyleExists = True
        Catch ex As ArgumentException
        End Try
    End Function
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 23:21:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658236#M19390</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2012-10-12T23:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658238#M19391</link>
      <description>&lt;P&gt;anyway of copying a pointstyle. Or would I have to iterate through all the various point style pieces &amp;amp; recreate them in a new style? &amp;amp; If the only way is to iterate and copy each item into a new style using VB variables, is there a way of finding what block, if any, the marker is using?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 23:24:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658238#M19391</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T23:24:04Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658252#M19392</link>
      <description>&lt;P&gt;To copy a pointstyle (assuming you have the existing style ObjectId as id):&lt;/P&gt;
&lt;PRE&gt;            Using tr As Transaction = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction()
                Dim style As PointStyle = TryCast(id.GetObject(OpenMode.ForRead, False, True), PointStyle)
                Dim newId As ObjectId = style.CopyAsSibling(style.Name + " - (Copy)")
                tr.Commit()
            End Using
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for the point style marker, use the MarkerType and MarkerSymbolName properties of the style object.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See here for more info:&amp;nbsp;&lt;A href="http://docs.autodesk.com/CIV3D/2012/ENU/API_Reference_Guide/net/html/2953dd7d-c44a-9c3a-7fa0-74a3fef39159.htm" target="_blank"&gt;http://docs.autodesk.com/CIV3D/2012/ENU/API_Reference_Guide/net/html/2953dd7d-c44a-9c3a-7fa0-74a3fef39159.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 23:47:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658252#M19392</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2012-10-12T23:47:09Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658256#M19393</link>
      <description>&lt;P&gt;thanks.&lt;/P&gt;&lt;P&gt;I kinda can't wait 'til monday morning to try it all out.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Oct 2012 23:55:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3658256#M19393</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-12T23:55:20Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3659972#M19394</link>
      <description>&lt;P&gt;this:&lt;/P&gt;&lt;P&gt;Dim newId As ObjectId = style.CopyAsSibling(style.Name + " - (Copy)")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is causing a fatal error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was already in a transaction, &amp;amp; I figured this didn't need to be in its own (sub)transaction, so while troubleshooting, since the syntax in your code is a little different from what I'm used to , I figured I'd go ahead &amp;amp; nest it into another transaction, when I pasted this code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt; Using tr As Transaction = HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction()&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error&amp;nbsp;1&amp;nbsp;'Transactio' is not a member of 'Autodesk.AutoCAD.DatabaseServices.Database'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;is hostapplicationservices any different than the autocad database (which is what my transactions are started from)? I mean, is it something for civil 3d to allow transactions that work on things such as point styles?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;does any of this matter regarding the crashing on copyassibling?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried&amp;nbsp; opening the pointstyle as write instead of read, ut that didn't help&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 16:08:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3659972#M19394</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-15T16:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3659994#M19395</link>
      <description>&lt;P&gt;it figures, as soon as I send my last question, I noticed something that did in fact casue my problem. I was suppyling the objectID from a previous operation which was from a PointEntity&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 16:16:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3659994#M19395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-10-15T16:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: vb.net 2012 (cogo) point styles</title>
      <link>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3660002#M19396</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;it figures, as soon as I send my last question, I noticed something that did in fact casue my problem.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This happens to me more than I care to admit.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Oct 2012 16:19:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/civil-3d-customization-forum/vb-net-2012-cogo-point-styles/m-p/3660002#M19396</guid>
      <dc:creator>Jeff_M</dc:creator>
      <dc:date>2012-10-15T16:19:32Z</dc:date>
    </item>
  </channel>
</rss>

