All Activity
- Past hour
-
@GLAVCVS I type vlide@dsk in the command line, but it doesn’t do anything.
- Today
-
(defun c:bm () ;code;;;;;;;; (setq s (car(entsel))) (if s (progn (setq ar (vlax-ename->vla-object s)) (setq area (vla-get-Area ar)) (setq p (getpoint "\nselect point")) (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 100 "AcDbMText") (cons 10 p) (cons 40 0.3) (cons 71 5) (cons 1 (strcat "%<\\AcObjProp.16.2 Object(%<\\_ObjId " (itoa (vla-get-objectid ar)) ">%).Area \\f \"%lu2%pr2%ps\">%" ) ) (cons 7 "Standard") (cons 73 1) ) ) ) ; end progn ) ;code;;;;;;;; ) This part of the code displays the object area as: <\AcObjProp.16.2 Object(%<\_ObjId 2401165245680>%).Area \f "%lu2%pr2%ps" in AutoCAD model space. If you double-click on the text, it will show the object area. (example 100.00)
-
You could make them blocks, update one, the rest update. The best IMO would be, as mentioned by CyberAngel, custom properties that can be referenced by fields. You could also use LISP, etc., but since you mentioned fields, the custom properties and fields might be easier for you.
-
TDJ1992 joined the community
-
Laverne Elgar joined the community
-
Degomtoo joined the community
-
Is there a way to Crop images inserted into a dwg?
Ykozkaynak replied to Rosco's topic in AutoCAD General
Let me give you update from 8 more years, it helped me today! I hope someone sends a notification from 2033 too Or i will become the last ghost here... -
Ykozkaynak joined the community
-
Nitim joined the community
-
yangguoshe joined the community
-
JHON joined the community
-
Meg_Cain joined the community
- Yesterday
-
It works Thank you so much
-
Objects in a drawing share several general properties that determine their appearance. These include color, linetype, linetype scale, lineweight, and more. Properties, such as color and linetype, can be changed per individual object or across many objects with the use of layers. In our next installment of the AutoCAD Foundation blog series, we have a quick tip on how to change AutoCAD object properties. For the full tutorial on changing object properties and using layers, you can check out the AutoCAD Foundations article. How to Change AutoCAD Object Properties All objects that you create have properties. Object properties control the appearance and geometric characteristics of an object. The general properties that are common to most objects are as follows: Color Linetype scale Hyperlink Layer Plot style Lineweight Linetype Thickness All other properties are object type specific. When objects are selected, you can use the Properties palette to verify and change property values. If you select an object in your drawing, here is what you might see in the Properties palette. Notice that the current properties for the selected object are displayed in the Properties palette. You can change any of these properties by clicking it and changing the value. A property that is set to “ByLayer” inherits its value from its assigned layer. In the previous example, the line object’s color of magenta is inherited from its assigned layer of 20 ELECTRICAL. If you select several objects, only their common properties are listed in the Properties palette. If you change one of these properties, all selected objects are changed in one operation. When the Properties palette is displayed and no objects are selected, the current property values are of those to be assigned to newly created objects. Property values listed as ByLayer, indicate properties that inherit their values from the layer to which the object is assigned. For example, changing the Color property value from ByLayer to Red causes all subsequent objects to be assigned the Red color which overrides the value of the assigned layer. The Properties palette takes up a lot of space. For quick access to the most common properties, you can use the Properties panel on the ribbon. As you can see in this example, the listed properties will all be determined by the current layer. Keep Going There’s much more to learn about object properties and layers. Check it out in Change Object Properties and Organize Objects with Layers: AutoCAD Foundations. The post AutoCAD Object Properties: AutoCAD Foundations appeared first on AutoCAD Blog. View the full article
-
Elia joined the community
-
how to get to the power of ???
Elia replied to mkv123's topic in AutoCAD 2D Drafting, Object Properties & Interface
10^3- 14 replies
-
- special characters
- meter cube unit
-
(and 1 more)
Tagged with:
-
Mmm I forgot something very important: the convention When typing any file name, you must replace the . with @ For example: if you want to open "acad.lsp," you would type "acad@lsp"
-
Also think just modifying the open command to the filepath for notepad works: (vlax-invoke obj 'Run (strcat "c:/windows/notepad.exe \"" fnm "\"")) or (vlax-invoke obj 'Run (strcat "c:/windows/system32/notepad.exe \"" fnm "\""))
-
(defun c:**r** nil (if averigua (progn (vlr-remove **a**) (setq **a** nil averigua nil) (princ "Open-file Command-line DEACTIVATED");"SensiCMD DESACTIVADO") ) (progn (setq **a** (vlr-command-reactor "***" '((:vlr-unknowncommand . averigua)))) (defun averigua (a b / c) (if (setq c (findfile (vl-string-subst "." "@" (car b)))) ;;; (decodifica c) (LM:open c) ) ) (princ "Open-file Command-line ACTIVATED");"SensiCMD ACTIVADO") ) ) (princ) ) Here you go. Copy this code into the acad*.lsp file where you save your custom lisps. Once loaded, you can enable or disable the included code by typing the **r** command. I assume you've downloaded Lee Mac's code (LM:open). It's perfect for what you need, so I've included a call to "LM:open," but you'll have to add the code for this function yourself. As for the **r** command, when the included code is enabled, anything you type on the command line that matches the name of a file found in any of AutoCAD's "SupportPaths," "LM:open" will open it with the default Windows application. This will happen without any command being executed To disable the code, just run **r** again. PS: When typing any file name, you must replace the . with @ Example: to "acad.lsp" type "acad@lsp" I hope it's useful
-
How to correctly extract nested objects from blocks with scaling/mirroring)
Koz replied to p7q's topic in AutoLISP, Visual LISP & DCL
if you want to copy a non-block object, it can be done by ncopy command. Using VLISP, can call nentsel and pick a nest object, you can directly get the nest object and transform matrix as Lee mentioned, then rebuild the nest object and apply the matrix to it to "extract" the nest object out. -
issammesk started following text field
-
dear all these my problem every time i when modify station text must go for all text in red color and modified same station text so i think if i make afield for one to all text when modify in one text automatic change in all thanks again i applodt file for one of these dwg1FIELD-TEXT.dwg1FIELD-TEXT.dwg
-
Thanks Jerry and BigAl, The main use I have for this one is when I want to edit a LISP file - pop up dialogue to select the routine, open the file in notepad, 'Find' which usually takes me to the LISP name in the file. The find dialogue all happens without me needing to press any buttons. BIgAl - handy but in this case I know the file name and location to go straight to it - handy later in life if I don't know what file I want though, thanks MHUPP - going to look into that this morning, saving the answer into my "make windows work right" file Undoing the alias as in the link was the trick (Start Menu - settings - Apps - Advanced App Settings - Alias), pinned the proper notepad to the task bar (not the new one, located in c:\windows\notepad.exe or c:\windows\system32\notepad32.exe), now to set the proper notepad as the default as it should be.
-
Hello again, GLAVCVS. I don't want to sound impatient , but it seems like no one knows about the option you're talking about. Could you share it? Thanks in advance.
-
Maybe have a look at the windows command findstr it will search a directory for a key word, I guess could open one at a time. findstr d2 d:/mylisps/*.lsp may be useful how I find old posts
-
mhupp started following Find in Notepad
-
in windows 11 they have two notepads now. think you will have to remove the app one to go back to the classic one. https://www.dedoimedo.com/computers/windows-11-notepad-classic.html
- Last week
-
Attribute that updates based on location
Danielm103 replied to EYNLLIB's topic in AutoLISP, Visual LISP & DCL
Nice, I was thinking AcFdFieldReactor because it has all those plus REGEN, but it’s not available to lisp. You might add REGEN to the list, so the user can see the updated values without needing to save or plot. -
JerryFiedler started following Find in Notepad
-
@Steven P Your function seems to work for me although I am not sure what you expect. I am using Windows 11 and BricsCAD Pro V25. When I run my test program which calls your routine: NotePad++ is opened with the test data file, the specified text is highlighted and the text is in the "find" dialog box. ( I had to click the binocular icon as the find dialog did not open on its own.) Are you expecting the "find" dialog box to open automatically? testdata.txt testNF.lsp
-
Attribute that updates based on location
Lee Mac replied to EYNLLIB's topic in AutoLISP, Visual LISP & DCL
Here's a proof-of-concept example for consideration - (defun update-attributes ( / bln idx ins map obj sel tag val ) (setq ;; List of ;; ((lower-left point) (upper-right point) "attribute value") map '( (( 0.0 0.0) (10.0 10.0) "abc") ((20.0 20.0) (30.0 30.0) "def") ) ;; Block name bln "YourBlock" tag "YourTag" ) (setq bln (strcase bln) tag (strcase tag) ) (if (setq sel (ssget "_X" (list '(0 . "INSERT") '(66 . 1) (cons 2 (strcat "`*U*," bln))))) (repeat (setq idx (sslength sel)) (setq idx (1- idx) obj (vlax-ename->vla-object (ssname sel idx)) ) (cond ( (/= bln (strcase (vlax-get-property obj (if (vlax-property-available-p obj 'effectivename) 'effectivename 'name))))) ( (setq ins (vlax-get obj 'insertionpoint) val (vl-some '(lambda ( itm ) (if (vl-every '<= (car itm) ins (cadr itm)) (caddr itm))) map) ) (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (progn (if (vlax-write-enabled-p att) (vla-put-textstring att val) ) t ) ) ) (vlax-invoke obj 'getattributes) ) ) ) ) ) ) (defun block-position-callback ( rtr arg ) (if (and arg (wcmatch (strcase (car arg) t) "qsave,save,saveas,plot,publish")) (update-attributes) ) (princ) ) ( (lambda ( key ) (vl-load-com) (foreach rtr (cdar (vlr-reactors :vlr-command-reactor)) (if (= key (vlr-data rtr)) (vlr-remove rtr) ) ) (vlr-set-notification (vlr-command-reactor key '( (:vlr-commandwillstart . block-position-callback) ) ) 'active-document-only ) (update-attributes) (princ) ) "block-position-reactor" ) There is no command to run the program: simply amend the block name, tag name, and map at the top of the code to suit your setup, and then load the program - the attributes will be automatically updated when the drawing is saved or plotted. -
Attribute that updates based on location
EYNLLIB replied to EYNLLIB's topic in AutoLISP, Visual LISP & DCL
Probably a better idea. I have been looking into the object reactors and it was seeming like it was going to bog down the drawing immensely, since we will have dozens of these blocks in a single file. Thanks! -
Attribute that updates based on location
Lee Mac replied to EYNLLIB's topic in AutoLISP, Visual LISP & DCL
I would suggest using a single command reactor to automatically update all blocks on save or plot - this is far simpler than using an object reactor to track modifications to each individual block reference. -
Attribute that updates based on location
EYNLLIB replied to EYNLLIB's topic in AutoLISP, Visual LISP & DCL
The issue is CAD literacy within the office. One of my engineers would be fine to use it, but the rest are fairly CAD illiterate. I try to keep things as simple as possible (I know running a lisp command is simple to begin with) -
Steven P started following Find in Notepad
-
Good Morning, I have been using this to search for text in a text file, now I have been upgraded to windows 11 it doesn't work, and I can't work out what change to make. Looking for some guidance again, thanks! fnm: File name (including filepath) str: Text String delay: a delay, say 1000 mS Will open notepad and should perform a 'find' to jump to the text. It gets as far as 'find' to open the dialogue box but won't populate it or hit 'enter' to do the find, using sendkeys - which has always worked before. thanks for any help ;;To find text within a text file. ;;http://www.cadtutor.net/forum/showthread.php?102326-Open-text-file-and-jumping-to-a-line&p=694572#post694572 ; example command to call it (NotepadFind "C:\\Downloads\\test 123.txt" "findtext" 300) (defun NotepadFind (fnm str delay / obj) (vl-catch-all-apply (function (lambda () (setq obj (vlax-get-or-create-object "WScript.Shell")) (vlax-invoke obj 'Run (strcat "Notepad.exe \"" fnm "\"")) ;; or notepad++ if that is used. (setvar 'cmdecho 0) (command "_.delay" delay) ; Milliseconds. For BricsCAD users: (sleep delay) does not work. (setvar 'cmdecho 1) (vlax-invoke obj 'AppActivate "Notepad++") ; Title bar name of application. ++ for notepad++ but still works? (vlax-invoke obj 'SendKeys (strcat "^f" str "{ENTER}{ESC}")) ) ) ) (if obj (vlax-release-object obj)) )
-
mhupp started following Create Camera view that reflects what you see
-
Create Camera view that reflects what you see
mhupp replied to pyou's topic in AutoLISP, Visual LISP & DCL
Camera command does 90% what your asking idk if it says layer states tho. -
pyou started following Create Camera view that reflects what you see
-
Hello Is it possible to create a camera view in a drawing that captures what is currently visible, using a LISP command instantly? For example, when I rotate a 3D object and want to take a "screenshot" of that specific view. The proposed idea is to create permanent camera icons (or similar markers) in the drawing, allowing me to click on them to instantly switch to the saved viewing position as it was captured to review area. Thank you!