Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/24/2021 in all areas

  1. I know that you can use Quick Select on a selection set (which is what's involved in specifying an area). I don't think it's possible to use Select Similar because you've already got a selection set in play. If I had to do this, I'd list the relevant properties of the item to match, select the area, and use Quick Select to locate my target(s). You can specify that Quick Select will include, exclude, or append the new items in the current set. Edit: That will let you apply multiple properties in sequence. It's possible to isolate the items in the area and use Select Similar on them, but I believe that hidden items will be included in the results. Of course, it's always possible to write some code to do this. No doubt Lee Mac has something already cooked up.
    2 points
  2. I've tried rotating the viewport before, but I didn't know about the VPROTATEASSOC variable. You learn something every day about AutoCAD.
    2 points
  3. I just rotate the viewport. SEE THIS Maybe you are trying to recall MVSETUP? SEE THIS
    2 points
  4. Like mhupp said an object id never changes. That "####" was from something else that's been done. If you copy an object and field to another location in the same drawing the copied field will still be referencing the first object not the second since it's object id reference is the same. If you delete the original object all the fields referencing it will show you that "####". If you copy an object and field to another drawing the copied field will show you that "####" since it's object id reference isn't in that drawing and cannot be found.
    1 point
  5. Twist dview function by BlackBox https://forums.augi.com/showthread.php?174367-multiline-text-rotation&p=1344593#post1344593 Twist dview macro by Tom Beauford ^C^C^P(setvar 'angdir 1)(setvar 'snapang (getangle "Pick or enter TWist angle : "))(setvar 'angdir 0)(command "_.dview" "all" "" "_tw" (/(*(-(getvar 'snapang))180)pi) "") Twist dview function by Tom Beauford (defun c:TWistVP (/ *error* cmdecho angdir) (prompt "\rTWist") (defun *error* (msg) (and cmdecho (setvar 'cmdecho cmdecho)) (and angdir (setvar 'angdir angdir)) (if acDoc (vla-endundomark acDoc) ) (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 (and (setq cmdecho (getvar 'cmdecho)) (setvar 'cmdecho 0) (setq angdir (getvar 'angdir)) (setvar 'angdir 1) ) (progn (vla-startundomark (setq acDoc (vla-get-activedocument (vlax-get-acad-object))) ) (setvar 'snapang (getangle "Pick or enter TWist angle : ")) (setvar 'angdir 0) (command "_.dview" "all" "" "_tw" (/(*(-(getvar 'snapang))180)pi) "") ) ) (*error* nil) )
    1 point
  6. I'd never thought of rotating the actual viewport before, always using MVSETUP, thanks for the idea.
    1 point
  7. Like Cyber Angel used UCS OB for years then do UCS S and can save the ucs with a name handy when you want multiple swing angles, use UCS R name in viewport. A quick warning if a object is a 3d object result can be a wrong due to the Z's often drew a temporary line and used UCS OB erased temp line.
    1 point
  8. For 1 (vlax-for block (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) maybe do wcmatch i ie blk1002 ie found a block with 1002 in name ) for 2 I had a go using Multi radio buttons there is a option for A-Z its in the code examples at start of code, uses a defun to make the A-Z list its pushing the limits, use "H" horizontal option, when ran a variable BUT is set this is last item picked so default button will change to match last picked. (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (not but)(setq but 16)) (setq ans2 (ah:butts but "h" (make_letters "Please choose" 65 26))) Multi radio buttons.lsp
    1 point
  9. You will need to logout of 2018 and 2021. Restart your computer. Open 2021 and initiate the geomaps and let it prompt you to login there in 2021.
    1 point
  10. I think Mtext fields can only reference the Object ID and not the Handle. but you can convert them with (handent "handle") http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-AF6DD533-1A24-4687-96EB-F03F26050C07.htm,topicNumber=d30e618196 https://documentation.help/AutoCAD-ALISP-VLISP/WS73099cc142f4875516d84be10ebc87a53f-7a24.htm The object id should persist though saves if the object isn't deleted, exploded, or put into a block so its not the same "Entity" this should also change the handle to. I created a rectangle and moved the vertices around the filed wouldn't update until i used the regen command. you might want to keep an eye out to see when these fields change to #### its probably after running a lisp that's doing something funky.
    1 point
  11. The ALIGN command is probably not going to do what you want. It moves the actual object in model space, not your view of it. One option is to change the UCS in your viewport. You can use the Z option to rotate in two dimensions, all you do then is type in an angle. Once you've reset the UCS, use the PLAN command to rotate your view. Set your scale, lock the viewport, and you're done. That's my preferred method. Another option is the DVIEW command. I've never sat down and researched it, but it may work better for you. I'm sure there are other options, there always are.
    1 point
  12. This will allow you to change the folder location that opens starts in current drawing folder. Need write permission but nothing is saved. ;;----------------------------------------------------------------------------;; ;; OPEN WINDOWS EXPLORER TO FOLDER OF CURRENT DRAWING. (defun C:DIR () (setq path (strcat (getvar 'DWGPREFIX) "\\Enter or Save to Open Folder")) (if (setq fp (getfiled "Folder to Open:" path "" 33)) (startapp "explorer" (strcat "/n,/e," fp)) ) ) /n Open a new single-pane window for the default selection /e Open Windows Explorer in its default view also suggest to get power toys for fancy zone.
    1 point
  13. If you want to reliably rename layouts (or indeed any collection in which the item name constitutes a primary key and therefore must be unique), you will need to first rename the items to a temporary placeholder which is guaranteed to be unique within the current set and also unique within the target set. For example, with the code posted so far in this thread, there is no test as to whether the target name is already used by another item in the collection. Hence, if you were to run the program, reorder the layouts or delete & add a new layout with the same name, then the next run of the program would fail. This is because each layout is individually renamed as the code iterates over a set, and therefore every renaming operation must ensure that the target name does not conflict with another item in the set. Furthermore, you cannot guarantee that the order in which the layouts appear in the layout collection will match the order of layouts in a drawing (hence the purpose of the taborder property). One way to achieve a reliable rename is as follows: ;; Renumber Layouts - Lee Mac ;; Sequentially numbers all Paperspace layouts, with an optional prefix & suffix. (defun c:rl ( / int lst lyn ord pre sed suf ) ;; Obtain a valid (optional) prefix & suffix (setq pre (validstring "\nSpecify prefix <none>: ") suf (validstring "\nSpecify suffix <none>: ") lyn (list (strcase pre)) ) ;; Obtain list of layout objects, current names, and sort index (vlax-for lyt (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object))) (if (= :vlax-false (vla-get-modeltype lyt)) (setq lst (cons lyt lst) lyn (cons (strcase (vla-get-name lyt)) lyn) ord (cons (vla-get-taborder lyt) ord) ) ) ) ;; Construct a unique seed for temporary renaming (setq sed "%") (while (vl-some '(lambda ( x ) (wcmatch x (strcat "*" sed "*"))) lyn) (setq sed (strcat sed "%")) ) ;; Temporarily rename layouts to ensure no duplicate keys when renumbering (setq int 0) (foreach lyt lst (vla-put-name lyt (strcat sed (itoa (setq int (1+ int))))) ) ;; Rename layouts in tab order, with prefix & suffix (setq int 0) (foreach idx (vl-sort-i ord '<) (vla-put-name (nth idx lst) (strcat pre (padzeros (itoa (setq int (1+ int))) 2) suf)) ) (princ) ) (defun padzeros ( str len ) (if (< (strlen str) len) (padzeros (strcat "0" str) len) str) ) (defun validstring ( msg / rtn ) (while (not (or (= "" (setq rtn (getstring t msg))) (snvalid rtn) ) ) (princ (strcat "\nThe name cannot contain the characters \\<>/?\":;*|,=`")) ) rtn ) (vl-load-com) (princ)
    1 point
×
×
  • Create New...