Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/21/2023 in all areas

  1. YES. But a toolbar is so easy to make using Notepad. You can load custom toolbars using menu load, I had 2 custom toolbars, just copy the mnu or CUIX to a new pc and load it, all done. Explain what the toolbar needs in terms of command, the second part is if you need to make custom icons they need to be 32x32 in size. There are ways to make them for LASB. Simple Character icons. ***MENUGROUP=ALSTOOLBAR ***TOOLBARS **ALSTOOLS ID_ALAN_0 [_Toolbar("Alans1", _Right, _Show, 0, 0, 1)] ID_Matchprop [_Button("Match Properties", RCDATA_16_MATCH, RCDATA_16_MATCH)]^C^C_matchprop ID_Erase [_Button("Erase", RCDATA_16_ERASE, RCDATA_32_ERASE)]^C^C_erase ID_Copy [_Button("Copy", RCDATA_16_COPYOB, RCDATA_32_COPYOB)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_copy,^C^C_copy) ID_Mirror [_Button("Mirror", RCDATA_16_MIRROR, RCDATA_32_MIRROR)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_mirror,^C^C_mirror) ID_Offset [_Button("Offset", RCDATA_16_OFFSET, RCDATA_32_OFFSET)]^C^C_offset ID_Array [_Button("Array...", RCDATA_16_ARRREC, RCDATA_32_ARRREC)]^C^C_array ID_Move [_Button("Move", RCDATA_16_MOVE, RCDATA_32_MOVE)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_move,^C^C_move) ID_Rotate [_Button("Rotate", RCDATA_16_ROTATE, RCDATA_32_ROTATE)]$M=$(if,$(eq,$(substr,$(getvar,cmdnames),1,4),GRIP),_rotate,^C^C_rotate)
    2 points
  2. It depends on the target data type - for example, as noted in my previous post, you cannot convert a string representation of an entity name back to the entity pointer - you would instead need to derive the pointer from the handle or object ID.
    1 point
  3. Dealing with mostly blocks at my old job here is what I have learned. Account for the basepoint of the old blocks vs the new blocks or things will shift. Use insert with the block name = filepath to new block to update the block definition and all blocks of that type in the drawing. (command "_.Insert" (strcat blkname "=" filepath) PT 1 1 0) everything i worked on was at 0 degrees but you might have to take that into account as well.
    1 point
  4. Do the blocks have the same names, something like this offering from Lee Mac might work: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/update-blocks-amp-attributes-lisp/td-p/4399069 - search for redefining Blocks. For this the blocks are in a directory, each block saved as its own file (which is how I prefer to save them). or do the new and old blocks have different names? Not sure if something like Lee Macs Steal LISP will do that? Putting this here for now, part way done - it will get a list of all the block definitions in a drawing and loop through each in turn. In each block looping through each entity to see what it is. For now this just puts into the command line each type in each block. Command BlItemList Might be needing some more help shortly though, for example "do any blocks on page contain circle and text?" - does that mean -any- circle and -any- text or is it to be specified? This is the next step below, look at each item in a block and see if it matches a block to be replaced ;;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/get-entities-inside-a-block/td-p/2644829 (defun getblkitems ( EntName / nfo item items) (setq nfo (entget EntName)) (progn (vlax-for item (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object) ) ) (cdr (assoc 2 nfo)) ) (setq items (cons (vlax-vla-object->ename item) items)) ) ;end vlax ) ; end progn ) (defun GetBList (/ data name lst) ; returns block entity names (while (setq data (tblnext "block" (null data))) (setq name (cdr (assoc 2 data))) (if (wcmatch name "*|*,`*X*,`*U*,`*D*") nil (setq lst (cons (tblobjname "block" name) lst)) ) ) ) (defun c:BlItemsList ( / BlkItems n x enttypelist EntgetXType) (foreach n (GetBList) ; n: each bock entity (setq EntTypeList (list 0 0 0 0 0)) ;; Line (all types) Circle Text Hatch Arcs (setq BlkItems (getblkitems n)) (princ "\n:--")(princ n)(princ ": ")(princ BlkItems) (foreach x BlkItems (setq EntgetXType (cdr (assoc 0 (entget x)))) (if (wcmatch EntgetXType "LINE") (setq EntTypeList (mapcar '+ (list 1 0 0 0 0) EntTypeList))) (if (wcmatch EntgetXType "CIRCLE") (setq EntTypeList (mapcar '+ (list 0 1 0 0 0) EntTypeList))) (if (wcmatch EntgetXType "*TEXT") (setq EntTypeList (mapcar '+ (list 0 0 1 0 0) EntTypeList))) (if (wcmatch EntgetXType "HATCH") (setq EntTypeList (mapcar '+ (list 0 0 0 1 0) EntTypeList))) (if (wcmatch EntgetXType "ARC") (setq EntTypeList (mapcar '+ (list 0 0 0 0 1) EntTypeList))) (setq EntTypeList (subst 1 2 EntTypeList) ) ; make list 1 or 0s ) ; end foreach, x (princ EntTypeList) ) ; end foreach, n (princ) )
    1 point
  5. Your drawing is real mess... Recently I wrote something based on separated lines, but only for forming closed rectangular lwpolyline... With your DWG, it's not going to work; you have to do the job manually... For interes, here is the link of my *.lsp, but like I stated, it's just for that single case - there should be no trimmed collinear segments... One more thing that can help you : JOIN command have ability to connect collinear parts into single line... https://www.theswamp.org/index.php?topic=58344.msg614957#msg614957
    1 point
×
×
  • Create New...