• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • AutoCAD Civil 3D Customization

    Reply
    Distinguished Contributor
    Posts: 134
    Registered: ‎10-06-2008

    Styles to Toolbar

    251 Views, 4 Replies
    08-03-2012 01:10 PM

    I saw this post but can't find a good way to get my styles written to a toolbar:

     

    http://forums.autodesk.com/t5/AutoCAD-Civil-3D-Customization/Civil-3D-Styles-to-Toolbar/m-p/2879870/...

     

    do I simply write a lisp routine and put the shortcut name in my toolbar command line?  I don't know what the "change surface style" command is.  Please help.  Thanks.

    Please use plain text.
    Active Contributor
    Posts: 30
    Registered: ‎02-17-2010

    Re: Styles to Toolbar

    08-05-2012 01:43 PM in reply to: clay_carr

    I am somewhat unsure whether it can done on AutoLisp, but you can at least get some kind of a handle (in my case it looks like  Style = #<VLA-OBJECT IAeccSurfaceStyle 1547ffe0>) for a style used for a surface like that:

    (setq ent (car (entsel "\nSelect Main Object: ")))
    (setq oEnt (vlax-ename->vla-object ent))
    (vlax-dump-object oEnt)

     Then I do not know whether you can only see it or even change. Another option which should work at least for 2013 is to write several commands in .net and then add them to a toolbar. I can think of two alternatives: either you have lots of styles in the drawing and each of the commands change the style of a surface to one of them, or these commands change the current surface style (it should not be a problem if you name surface style after your surface's name). Hope this helps somehow.

     

    BR, Viktors

     

    Please use plain text.
    *Expert Elite*
    Posts: 3,052
    Registered: ‎07-22-2003

    Re: Styles to Toolbar

    08-05-2012 01:57 PM in reply to: clay_carr

    What do you want on the toolbar? Give some specifics and I may be able to point you in the right direction.

    Jeff_M, also a frequent Swamper
    Please use plain text.
    Distinguished Contributor
    Posts: 134
    Registered: ‎10-06-2008

    Re: Styles to Toolbar

    08-06-2012 07:32 AM in reply to: clay_carr

    for examle I have a "_JS-no display" style that i toggle to "JS - Proposed Contours 1' and 5'" frequently.  Ultimtaley i would like to build a toolbar and share with everyone at this firm to have all (lets say 20) surface styles.  This may also be helpful with spot elevations that have different rotations. 

    Please use plain text.
    Member
    Posts: 5
    Registered: ‎08-25-2009

    Re: Styles to Toolbar

    02-10-2013 03:37 PM in reply to: clay_carr

    Search under my name I posted yesterday the code in VLISP to do what you want at another post.

    Please use plain text.