This is a re-post of a previous post that deserves to be re-posted. The routine was posted at theswamp.org by Kerry and can be found here: http://www.theswamp.org/index.php?topic=33493.msg389031#msg389031
The routine simply splits an existing dimension and lets you click a point between the dimension to define a new inner dimension.
- SPLITDIMS [enter] to start
- Select dimension to split
- pick a new point
(defun c:LegLengthMod ( / ss dimobjs)
;; codehimbelonga KerryBrown@theSwamp 2010.05.28
(if (and (setq ss (ssget '((0 . "DIMENSION"))))
(setq dimobjs (mapcar 'vlax-ename->vla-object
(vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
(foreach dim dimobjs
(vla-put-extlinefixedlensuppress dim :vlax-true)
(vla-put-extlinefixedlen dim (* 2 (vla-get-textheight dim)))
(defun c:SplitDims (/ sel newpt ent edata elist)
;; codehimbelonga KerryBrown@theSwamp 2010.05.28
(if (and (setq sel (entsel "\nSelect Dimension to Split."))
(setq newpt (getpoint "\Select new Dim Point"))
(progn (setq ent (car sel)
edata (entget ent)
(member (car pair)
(list -1 2 5 102 310 300 330 331 340 350 360 410)
(entmod (subst (cons 14 newpt) (assoc 14 elist) edata))
(entmakex (subst (cons 13 newpt) (assoc 13 elist) elist))
The LISP routine featured today is by Marko Ribar and can be found at CADTutor.net at the following Link: http://www.cadtutor.net/forum/showthread.php?88293-EXTRIM-Between-Two-Lines&p=605998&viewfull=1#post605998 If you have any questions or requests or even saying a “Thank you” to Marko, about the routine, please post them at the forum. I am sure that Marko would like to know if he needs to tweak anything and would appreciate any gratitude.
Please copy the code from the CADTutor link above
The routine uses the concept of the EXTRIM command that is found in the Express Tools and applies this approach to trimming objects that cross both of the selected edges (boundaries).
- EXB2C [enter]
- Select 2 separate objects to define the trimming edges
- Click the cursor between the 2 edges that you selected to define the area that you want trimmed.
Note that if objects do not cross both of the edges that you select, the outcome seems to not want to trim certain objects (shown below).
But if this is the scenario that you encountering, you should just use the Express Tool EXTRIM to accomplish what you need (shown below). You might also find the following link to another LISP routine that puts a spin on the EXTRIM command as a helpful tool as well: http://autocadtips.wordpress.com/2012/03/08/autolisp-trim-objects-on-one-side/
This issue comes up rather often when dealing with projects that use CADWorx. Some users use CADWorx and other people in the same project don’t. Perhaps they want to simply open a P&ID drawing (or other drawing that uses this file for linetypes) with just “vanilla” AutoCAD and upon opening the drawing they are greeted with the ever-annoying prompt that says: “One or more SHX files are missing. What do you want to do?”
If you don’t have CADWorx installed on your machine, simply ignore this so that you don’t alter the drawing and how it is supposed to look/display. Then go find someone who does have CADWorx and ask if you can copy the “compiled shape file” (That is what an .shx file is…) and copy it to you your AutoCAD support path.
Most likely the culprit is the .shx file called “Cfm.shx” and it is located in the default CADWorx support path on your C: drive as shown below.
In the example below, I am using AutoCAD 2013 with CADWorx P&ID 2013. Your versions will vary but the file name of “Cfm.shx” remains the same. Also not that when you browse to your AutoCAD support path, it will not be the same as mine after the “Users” portion…
Shown below are some of the linetypes that use this .shx file that are unique and therefore, you can see why you wouldn’t want to simply replace the linetype upon opening…
It may seem like a great idea to use the layer “DEFPOINTS” as the layer for your viewports since it doesn’t plot by default. And you may have heard from various posts that you shouldn’t do so but may have not understood why…
It has to do with both Layer 0 (zero) and Defpoints.
Note: I am using “Layer 0 (zero)” because I dont want the zero to be confused as the capital letter O.
Layer zero is reserved for objects like blocks so if they are set to layer zero and you insert them into a drawing, the current layer could be set to anything, and that block will now be on that layer. So CAD managers might have Layer 0 (zero) turned off or even frozen so that people don’t use this layer to draw objects that should be on a designated layer.
If layer 0 (zero) is not turned off or frozen, you can select everything as normal (shown below
Let’s say that you Freeze Layer 0 (zero) [shown below]
Now try to select the same layers that were select-able prior to Layer 0 (zero) being frozen. You will notice that you cant select the objects that are on the DEFPOINTS layer. It’s like some sort of force field has been applied to these objects…
So how will this cause issues?
If your viewports are on the DEFPOINTS layer, and you want to later come and change the scale of the viewport, you will not be able to select the viewport. However, you can still double click inside the viewport to adjust the scale but some people use DEFPOINTS for placing other objects that they don’t want to plot like text that serve as notes or whatever. If they later what to erase them or move them or edit them, they wont be able to do so.
If you have lost your CADWorx Ribbon tabs or Menus (from the menu bar) you can simply load them by using the following in the command line:
CADWorx 2013 and AutoCAD 2013 are shown in the above pic
For loading the CADWorx Equipment palette or toolbars see the following post: http://autocadtips.wordpress.com/2013/06/21/cadworx-equipment-palette/
A friend of mine also has a great blog post explaining how to load both the CADWorx Plant and Equipment modules in the same session found here: http://streamlined-design.blogspot.com/2013/07/use-acadrx-to-load-cadworx-plant-and.html
Please keep the Streamlined Design blog in mind for some terrific advanced AutoCAD customization tips & techniques for CAD managers and CAD admins. There are also some .NET programming examples available
Today’s tip is simply a link to an excellent AutoCAD alias and shortcut reference guide provided by Autodesk & The AutoCAD team.
The link is found here: http://www.autodesk.com/store/autocad/autocad-shortcuts
I highly recommend learning command aliases like using XR in the command line instead of XREF or W instead of WBLOCK.
Note: There are many other useful examples in the linked resource. So don’t get overwhelmed or try to memorize all of them. If I could make a suggestion, skim the list of aliases or hot keys for the commands or tools that you use the most in your daily drafting routines and make a note of a few of them and try to utilize a couple one day at a time.
One more thing to note is that these are the default (out of the box) shortcuts and command aliases. Once you are comfortable with some of these default shortcuts you might realize that there are some default aliases that since they are assigned to an existing command. Luckily you can easily create brand new aliases and assign them to a command or you can assign an unused alias to a command.
A couple of examples of custom aliases that I use are CC = COPY, RR = ROTATE, SS = SELECTSIMILAR.
These aliases can be edited in the “Alias Editor” which appends the acad.pgp file.
For more help in running the ALIASEDIT command, refer to this previous post: http://autocadtips.wordpress.com/2010/11/06/system-variables-dialog-box/
Thank you to the AutoCAD team for making this list of shortcuts & aliases available in such an easy and thorough format.