+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18
  1. #1
    Senior Member tomhamlet's Avatar
    Computer Details
    tomhamlet's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL Desktop
    CPU:
    AMD phenom 2 (6 core)
    RAM:
    6gig
    Graphics:
    1 gig
    Primary Storage:
    1 tb
    Monitor:
    Dell widescreen
    Discipline
    See details...
    tomhamlet's Discipline Details
    Occupation
    mechanical engineer, draftsman
    Discipline
    See details below.
    Details
    At Denios, we design storage and containment units for hazerdous materials. We also design cranes, racks, or whatever the customer needs.
    Using
    Mechanical 2011
    Join Date
    Oct 2012
    Location
    Louisville, KY
    Posts
    122

    Question So we meet again!

    Registered forum members do not see this ad.

    What an extended absence . But of course there is more to this post.

    A while back I made an icon so that the drafters in my company could put the right border in the right spot with a click of the mouse. here was my macro:

    (command ".insert" "I:/borders/11x17" "0,0" "1" "1" "0")

    This inserts the border on the drawing at coordinates 0,0 at a scale of 1 and a rotation of 0 degrees. But if i wanted to make this where you had to choose an insertion point, how would i go about doing that? my first thought is:

    (command ".insert" "I:/borders/11x17" "0" "1" "0")

    is this close?
    Hard work beats talent every time talent doesn't work hard.

  2. #2
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Code:
    (command ".insert" "I:/borders/11x17" pause "1" "1" "0")
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  3. #3
    Senior Member tomhamlet's Avatar
    Computer Details
    tomhamlet's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL Desktop
    CPU:
    AMD phenom 2 (6 core)
    RAM:
    6gig
    Graphics:
    1 gig
    Primary Storage:
    1 tb
    Monitor:
    Dell widescreen
    Discipline
    See details...
    tomhamlet's Discipline Details
    Occupation
    mechanical engineer, draftsman
    Discipline
    See details below.
    Details
    At Denios, we design storage and containment units for hazerdous materials. We also design cranes, racks, or whatever the customer needs.
    Using
    Mechanical 2011
    Join Date
    Oct 2012
    Location
    Louisville, KY
    Posts
    122

    Default

    thank you!
    Hard work beats talent every time talent doesn't work hard.

  4. #4
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Quote Originally Posted by tomhamlet View Post
    thank you!
    You're welcome.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  5. #5
    Senior Member tomhamlet's Avatar
    Computer Details
    tomhamlet's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL Desktop
    CPU:
    AMD phenom 2 (6 core)
    RAM:
    6gig
    Graphics:
    1 gig
    Primary Storage:
    1 tb
    Monitor:
    Dell widescreen
    Discipline
    See details...
    tomhamlet's Discipline Details
    Occupation
    mechanical engineer, draftsman
    Discipline
    See details below.
    Details
    At Denios, we design storage and containment units for hazerdous materials. We also design cranes, racks, or whatever the customer needs.
    Using
    Mechanical 2011
    Join Date
    Oct 2012
    Location
    Louisville, KY
    Posts
    122

    Default

    one more question. If i have a layer named DIMENSION and I would like the tag to come in on that layer no matter what layer I am currently using, can this be done through a macro or does that exceed its limitations?
    Hard work beats talent every time talent doesn't work hard.

  6. #6
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Quote Originally Posted by tomhamlet View Post
    one more question. If i have a layer named DIMENSION and I would like the tag to come in on that layer no matter what layer I am currently using, can this be done through a macro or does that exceed its limitations?
    This is a common request... You essentially have two options:

    You can use Command calls in your macro to store the existing layer, set the desired layer, and restore when done, but this lacks error handling if the user hits escape, etc..

    Or, you can use a LISP routine (macros can call LISP instead of using Diesel), which includes the appropriate error handling.

    Last, you can use a Visual LISP Reactor, which always set the desired layer based on the use of a specific Command... Not sure if this is good for you here, but I use this for XREFs, Images, etc.. The benefit here, is that no custome command, or macro is required, the user can use Ribbon, Menu, or Keyboard Alias.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  7. #7
    Senior Member tomhamlet's Avatar
    Computer Details
    tomhamlet's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL Desktop
    CPU:
    AMD phenom 2 (6 core)
    RAM:
    6gig
    Graphics:
    1 gig
    Primary Storage:
    1 tb
    Monitor:
    Dell widescreen
    Discipline
    See details...
    tomhamlet's Discipline Details
    Occupation
    mechanical engineer, draftsman
    Discipline
    See details below.
    Details
    At Denios, we design storage and containment units for hazerdous materials. We also design cranes, racks, or whatever the customer needs.
    Using
    Mechanical 2011
    Join Date
    Oct 2012
    Location
    Louisville, KY
    Posts
    122

    Default

    so if i was going to go ahead and add it into my macro, would this work:

    Code:
    (command ".clayer" "dimension") (command ".insert" "I:/borders/11x17" pause "1" "1" "0")
    Hard work beats talent every time talent doesn't work hard.

  8. #8
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    Quote Originally Posted by tomhamlet View Post
    so if i was going to go ahead and add it into my macro, would this work:

    Code:
    (command ".clayer" "dimension") (command ".insert" "I:/borders/11x17" pause "1" "1" "0")
    What happens when you try it for yourself?
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  9. #9
    Luminous Being BlackBox's Avatar
    Computer Details
    BlackBox's Computer Details
    Operating System:
    Windows 8.1 Professional, Server 2012 R2 Datacenter
    Computer:
    Dell Precision T3600
    CPU:
    Hex-Core Intel Xeon 3.2Ghz
    RAM:
    32GB
    Graphics:
    3GB NVIDIA Quadro K4000
    Primary Storage:
    2 x 240GB Samsung EVO SSD (RAID 0)
    Secondary Storage:
    1TB Western Digital VelociRaptor 10K RPM
    Monitor:
    Dual 24" Dell Ultrasharp Widescreen Monitors
    Discipline
    Civil
    BlackBox's Discipline Details
    Occupation
    Senior Civil Designer
    Discipline
    Civil
    Details
    Public/Private Land Development, Transportation, and Utilities.
    Using
    Civil 3D 2016
    Join Date
    Nov 2009
    Posts
    5,282

    Default

    If I were going to do this with a Macro, I'd load this LISP code:

    Code:
    (defun c:Insert11x17Border (/ *error* layerName oldClayer)
      
      (defun *error* (msg)
         (and oldClayer (setvar 'clayer oldClayer))
         (cond ((not msg))                                                  ; Normal exit
               ((member msg '("Function cancelled" "quit / exit abort")))   ; <esc> or (quit)
               ((princ (strcat "\n** Error: " msg " ** ")))                 ; Fatal error, display it
         )
         (princ)
       )
    
      (if (tblsearch "layer" (setq layerName "Dimension"))
        (progn
          (setq oldClayer (getvar 'clayer))
          (setvar 'clayer layerName)
          (command "._insert" "I:/borders/11x17" pause "1.0" "1.0" "0.0")
        )
        (*error* (strcat "\"" layerName "\" layer not found"))
      )
      (*error* nil)
    )
    ... And use one of the following Macros... This if the LISP file is loaded at Drawing open:
    Code:
    ^C^C^PInsert11x17Border ^P
    ... This if demand loading the LISP file the first time the button is hit:
    Code:
    ^C^C^P(if (not c:Insert11x17Border)(load "Insert11x17Border.lsp")) Insert11x17Border ^P
    ... Presuming the LISP file name is "Insert11x17Border.lsp" and resides within the SFSP.
    "Potential has a shelf life." - Margaret Atwood
    AutoCAD, and Civil 3D Certified Professional | Autodesk Authorized Developer
    Sincpac C3D ~ Exchange Apps ~ Autoloader ~ AutoCAD Security

  10. #10
    Senior Member tomhamlet's Avatar
    Computer Details
    tomhamlet's Computer Details
    Operating System:
    Windows 7
    Computer:
    DELL Desktop
    CPU:
    AMD phenom 2 (6 core)
    RAM:
    6gig
    Graphics:
    1 gig
    Primary Storage:
    1 tb
    Monitor:
    Dell widescreen
    Discipline
    See details...
    tomhamlet's Discipline Details
    Occupation
    mechanical engineer, draftsman
    Discipline
    See details below.
    Details
    At Denios, we design storage and containment units for hazerdous materials. We also design cranes, racks, or whatever the customer needs.
    Using
    Mechanical 2011
    Join Date
    Oct 2012
    Location
    Louisville, KY
    Posts
    122

    Default

    Registered forum members do not see this ad.

    i really used it for a set of tags. my company has 9 tags, the tag is a hexagon with a callout number inside 8 of which have arrows in directions in 45 degree intervals. so i made this pallette to make it easier to insert these without having to go through windows explorer everytime. I used the border example because they were closely related with the insert command and i felt using that would be easier to explain, then just associated the "pause" with these new commands.

    tags.jpg

    so now they can just hit the button associated with the desired tag.

    I did try the other macro to change the layer and it works! the only negative side is that the layer stays on dimension, though it is still much easier then what we have been doing, i foresee complaints from these old men
    Hard work beats talent every time talent doesn't work hard.

Similar Threads

  1. Meet AutoCAD 2014
    By AutoCAD Tips Blog in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 2nd Apr 2013, 01:30 am
  2. Meet AutoDesk
    By addesigns in forum AutoCAD General
    Replies: 8
    Last Post: 23rd Feb 2012, 02:43 pm
  3. making center lines meet cleanly
    By the ber in forum AutoCAD Beginners' Area
    Replies: 8
    Last Post: 21st Feb 2007, 08:14 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts