All Activity
- Past hour
-
increase or decrease value of attdef...help
SLW210 replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
Threads merged. -
Block definition modification - adding 2 attributes.
SLW210 replied to pefi's topic in .NET, ObjectARX & VBA
Probably the same either way. LISP/Script would be quite capable, lot's of code around for adding attributes, pretty sure Lee Mac has something. VBA, IMO, might have a slight advantage running on multiple drawings. .NET or Python an option? - Today
-
pefi changed their profile photo
-
pefi started following Block definition modification - adding 2 attributes.
-
I need to modify a few block definitions per drawing by adding 2 new attributes. Fixed location, they wont be visible, so I do not care if they are overlapping with other content or not. I use them as a "meta data" storage. Now, what's the best way to do it? I'm considering reinserting the block (prepared separately, with required modifications) or editing the block definition in place. The number of drawings and blocks is too large for manual modifications. I'm OK with LISP as well, but I will be populating the data from excel, so VBA seems to be the natural choice. Any advice if there is abetter way of doing it? Any opinions, comments, are more than welcome. I'm at the "brain storm" stage P.S. I currently open the block editor, paste the 2 attributes, close block editor, attsync, done. Maybe recreating that process in a scripted way with LISP would be easier?
-
Adding data to property lookup tables
jamami replied to jamami's topic in AutoCAD Drawing Management & Output
If it does require manual input I suspect the default tableay be the quicker method as fairly easy to type and tab down -
Adding data to property lookup tables
jamami replied to jamami's topic in AutoCAD Drawing Management & Output
Looks interesting but Does this still require manually inputting 309 lines of data in 3 tables , each with multiple columns ! -
Mine is in my support folder..
- Yesterday
-
increase or decrease value of attdef...help
BIGAL replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
This post is like option 2 of this post. Is there an option 3 ? Will answer last question in other post. Suggest keep all in one post. Give this a try does both requests. (defun c:addval ( / lst lst2 att cnt lst3) (setq inc (getreal "\nEnter increment + or - ")) (setq ss (ssget '((0 . "TEXT,ATTDEF")))) (setq lst '() tnum 0 tatt 0) (repeat (setq x (sslength ss)) (setq obj (vlax-ename->vla-object (ssname ss (setq x (1- x))))) (setq objname (vlax-get obj 'objectname)) (if (= objname "AcDbText") (progn (vlax-put obj 'textstring (rtos (+ (atof (vlax-get obj 'textstring)) inc) 2 0)) (setq tnum (1+ tnum)) ) (progn (vlax-put obj 'tagstring (rtos (+ (atof (vlax-get obj 'tagstring)) inc) 2 0)) (setq tatt (1+ tatt)) ) ) ) (alert (strcat (rtos tnum 2 0) " text changed \n" (rtos tatt 2 0) " tags Changed")) (princ) ) If you introduce more objects may need a cond rather than using IF. -
Adding data to property lookup tables
BIGAL replied to jamami's topic in AutoCAD Drawing Management & Output
I don;t think you need Excel. You can match a dcl to a dynamic block so you can enter values and then in turn update the block. It is something I have insert block and the dcl is displayed, its global code so works with any dynamic block. Need a dwg with your block and can test. -
increase or decrease value of attdef...help
GLAVCVS replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
Masterful -
jamami started following Adding data to property lookup tables
-
I am updating a dynamic block using dummy parameters to achieve multiple visibility states, I have got it working at 2m and 3m by manually inputting data but I need to go to 40m and there are 9 visibility states for for each length. I can generate the data in Excel and ideally I want to cut paste this into the property lookup table but this is not possible. I can cut paste into a block property table but not a lookup table and adding 300+ lines manually in 3 separate tables is not practical. The attached image shows one table completed for 2 and 3m lengths. Can this data be scripted ?
-
rlx started following increase or decrease value of attdef...help
-
increase or decrease value of attdef...help
rlx replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
Load VT , start with VT (or C:VT) Click on one of the attdef's , you get the main dialog Click on setup (bottom right) and change difference to 5 , click on ok to return to main dialog Finaly click on Renum and select all attdefs , enter, done... VT uses grread in a constant loop so exit with escape, cancel or spacebar that will get you in quick menu and you can escape / Quit / cancel from there. Not all buttons will work because some are company specific like revision but for now it should get you what you need. VT.LSP -
Field update issues in dynamic block
jamami replied to jamami's topic in AutoCAD Drawing Management & Output
the attached video shows the issue we are experiencing. selecting 'Evaluate' on the Field formula box blows up the expression :- {\urtf1\ansi\ansicpg65001\deff0\deflang2057{\fonttbl{\f0\fnil\fcharset0 MS Shell Dlg 2;}} \viewkind4\uc1\pard\f0\fs17\{\\urtf1\\ansi\\ansicpg65001\\deff0\\deflang2057\{\\fonttbl\{\\f0\\fnil\\fcharset0 MS Shell Dlg 2;\}\}\par \{\\colortbl ;\\red190\\green190\\blue190;\}\par \\uc1\\pard\\f0\\fs17 250+\\highlight1\\kerning1\\protect 2250\}} Video Project 1.mp4 -
leonucadomi started following increase or decrease value of attdef...help
-
increase or decrease value of attdef...help
leonucadomi replied to leonucadomi's topic in AutoLISP, Visual LISP & DCL
hello: Now I find myself in another situation. I have an attdef group I would like to be able to make a selection in a window and that the numbering is increased or decreased by a desired amount. maintaining the numbering format with zeros examplse (001,020,999) example: any help you can provide, thanks. Drawing2.dwg -
Field update issues in dynamic block
jamami replied to jamami's topic in AutoCAD Drawing Management & Output
it is an issue on a few machines here in the office. I saw a post on autodesk forum suggesting it was UTF-8 coding setting in windows regional settings, I have tried changing this but it has had no effect. Block attached with both field and dim variants _d-spans.dwg -
@jim78b Have you tried the Autodesk Design Center? You can drill into drawings and pull out blocks, layers, etc.. You can use a short program to pull up design center in the folder you want - something like: ;;-------------------------------------------------------- ;; Command: (C:DSN) ;; Description: ;; This Command Starts the AutoCAD Design Center window ;; in the path specified. ;;-------------------------------------------------------- (defun c:DSN ( / usrpath) (setq usrpath "C:\\MyBlocks");<--CHANGE TO YOUR PREFFERED LOCATION. (if (= (getvar "adcstate") 0) (if usrpath (command "._adcnavigate" usrpath)) (command "._adcclose") ) (princ) ) ;; End Command "DSN"
-
@jim78b You cannot make an AutoLISP or Visual LISP program have a modeless interface like your example unless you use a third party add-on called OpenDCL or another called ObjectDCL. Using those is also very advanced programming. Otherwise, DCL in AutoLISP can only make simple Modal dialogs (meaning you can't work in the graphics editor when they are displayed).
-
Field update issues in dynamic block
SLW210 replied to jamami's topic in AutoCAD Drawing Management & Output
Your Field inside your Formula needs an object selected. I just picked the top line and it works for me. Not sure if that works for the correct value, so you may need something else to pick. _d-spans fixed.dwg -
ok you are the best thanks for your time and support!
-
I am waiting for IT to install some things including updates for Visual Studio, when that gets done, I'll look into writing something better. The LISP that was posted in your other thread was a better start than this.
-
Ok for now thanks, I thought it was much simpler. Thanks a lot
-
As I have already mentioned, that LISP has too many issues. I trash canned all of my attempts, @pkenewell is correct, I had something else in there. I'll try to think about it. Yes, I had nil there. Every issue I tracked down, a new one came up. Just forget that LISP and start from scratch.
-
https://apps.autodesk.com/ACD/it/Detail/Index?id=8055037424722464637&appLang=en&os=Win64
-
@jim78b I don't understand what you mean. Again - if you want this program to be property troubleshooted, please provide an example drawing and a visual explanation if what you are expecting to happen.
-
@pkenewell I dont know how , when, or why but I can see the acadauto.chm to work I did a copy file from Copy and paste chm and paste to the dwg , and despite vlide show the same alert NOT FOUND , it work.
-
Sorry, but thank you for your hard work. It works now, but: I thought I had a window always open with the block list that automatically updates without me having to select anything. I'd like the window to stay open even when I'm working. If I click on a block name, it highlights in the drawing. Sorry if I wasn't specific. Thanks