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 Styles to Toolbar

3 REPLIES 3
Reply
Message 1 of 4
jjvail
725 Views, 3 Replies

Civil 3D Styles to Toolbar

Hi all, I saw a nifty toolbar on a AUI presenters Civil 3D. He had created a toolbar that assigned his personal surface styles to a surface. After much research, I am thinking I willl need to copy and modify macros of the Edit Surface Style command. Am I on the right track and does anyone know where I can find some tutorials or references? Thanks for the info........Peace

 

Jethro

3 REPLIES 3
Message 2 of 4
Jeff_M
in reply to: jjvail

Probably was done with some lisp. If the class you were in was given by David Garrigues, I think that he posted the lisps in the class materials. This would give you a starting point.

 

Also, another David (Dave Couch) was setting up swapping label styles in much the same way. There is a thread on here discussing this and should have some code to help you: http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/Change-Label-Style/m-p/2532491#M3976

 

 

Jeff_M, also a frequent Swamper
EESignature
Message 3 of 4
jjvail
in reply to: Jeff_M

Thanks Jeff, yes David G was the presenter. Unfortunately he didnt get into how he created his toolbars and I looked through lisps but no luck. Maybe he will respond to my question and I will keep on searching for a solution. Thanks again

Message 4 of 4
jefflyons2968
in reply to: jjvail

Hint: Most Civil objects have a .STYLE property or .LABELSTYLE property (string name), I have a bit of code that simply assigned the selected object to a basic acad object type... see below

 

Expand this code to specifiy a target style (object or label) instead of picking it...

 

Public Sub MatchStyle()

    Dim obj As AcadObject
    Dim sobj As AcadObject
    Dim tobj As AcadObject
    Dim slbl As AcadObject
    Dim tlbl As AcadObject
    Dim p1 As Variant
   
    On Error Resume Next
    ThisDrawing.Utility.GetEntity obj, p1, "Pick Source Style -> "
   
    Do Until Err.Number <> 0
        If Err.Number = 0 Then
            'is this a LabelStyle or an Object Style?

            If InStr(1, obj.ObjectName, "Label", vbTextCompare) > 0 Then
                'select target
                Set slbl = obj
                ThisDrawing.Utility.GetEntity tlbl, p1, "Pick Target Label Styles to be Changed -> "
                tlbl.LabelStyle = slbl.LabelStyle
            Else
                'select target
                Set sobj = obj
                ThisDrawing.Utility.GetEntity tobj, p1, "Pick Target Object Style to be Changed -> "
                Set tobj.style = sobj.style
               
            End If
        End If
    Loop
    Err.Clear
    Err.Number = 0
    On Error GoTo 0
   
   

End Sub

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report