Recent Posts

Pages: [1] 2 3 ... 10
I want to re-order my custom lookup tables in a block I created so they are in logical order. Re-creating the block with the tables in a different order would take too long, as I have way too many tables with lots of information in each lookup table, so redoing the block would take me forever.  And I'm not talking about the Attribute order, this I know about. These are not Attributes.

Screen shot of block menu below: After having created my block with lookup tables I decided I needed to add additional lookups (for counting/data extraction). As you can see it would flow better if the "Inside Corner Count" lookup was right below the "Inside Corner Trim" lookup, not at the bottom of the list.

Yes, I know you're going to say "Why didn't you plan better or put it there when you made the block?"... Because I didn't know I needed these add'l lookups at time of creation and I'm always adding more.

So, any way to re-order Lookup tables??  I can't find anything online.

Thank you for any help or just ideas/thoughts in general.
What is ubeliveable is that I can swear I used the same code I posted above once in ACAD and once in BCAD and as a result I did get 2 different length lwpolylines - paths... So I don't know what's the trick, I even used "all" option for selecting points - everything was done identically... Maybe you'll get third result, who knows??? In attachment are 2 my DWG files...
.NET / Re: System Variable Dialog Box
« Last post by jtoverka on Today at 08:43:20 AM »
I did some digging, I found it. I have AutoCAD Electrical 2018 with Express Tools installed.

Data file: C:\Program Files\Autodesk\AutoCAD 2018\Express\sysvdlg.dat
Program: C:\Program Files\Autodesk\AutoCAD 2018\Express\sysvdlg.arx
Glad I could Help :-)
Thanks Dlanor  :lol:
First off, your code seems to work like a charm!  Thank you very much for the quick response, that was driving me crazy.

In regards to your comment, the issue I was facing wasn't due to speed as, in order to troubleshoot, I copied bits of the code out and even just starting the dimension would fail with the method I was using.  I think it boils down to the method of object creation: I was operating from a clunky 'command line' approach while your routine, correctly, utilizes the vlax functions.

Thanks again - I will be utilizing the routine and learning a significant amount from your code!  :nerdystraight:
This could be a speed problem, you are accessing entlast immediately after the instruction to create it. Does the problem still occur if you cut out the entlast like this?

Code - Auto/Visual Lisp: [Select]
  1. (defun c:sds (/ doc spc ss cnt ent el spt ept mpt nobj)
  2.         spc (vlax-get-property doc (if (= 1 (getvar 'cvport)) 'paperspace 'modelspace))
  3.   )
  4.   (princ "\nSelect Boundaries: ")
  5.   (setq ss (ssget '((8 . "PP - Boundary"))))
  6.   (cond (ss
  7.           (repeat (setq cnt (sslength ss))
  8.             (setq ent (ssname ss (setq cnt (1- cnt)))
  9.                   el (entget ent)
  10.                   spt (vlax-curve-getstartpoint ent)
  11.                   ept (vlax-curve-getendpoint ent)
  12.                   mpt (vlax-curve-getpointatdist ent (/ (vlax-curve-getdistatpoint ent ept) 2.0))
  13.             );end_setq
  14.             (cond ( (= (cdr (assoc 0 el)) "LINE") (setq nobj (vlax-invoke spc 'adddimaligned spt ept mpt)))
  15.                   ( (= (cdr (assoc 0 el)) "ARC") (setq nobj (vlax-invoke spc 'adddimarc (cdr (assoc 10 el)) spt ept mpt)))
  16.             );end_cond
  17.             (mapcar '(lambda (x y) (vlax-put-property nobj x y)) (list 'layer 'stylename) (list "PP - Dims - Site" "Site Dims"))
  18.           );end_repeat
  19.         )
  20.   );end_cond
  21. )
AutoLISP (Vanilla / Visual) / Re: AutoLisp collapse of Speed?
« Last post by ronjonp on September 30, 2020, 10:42:00 PM »
Why don't you post your code? You will most likely get more help on this ... and as a bonus by some of the smartest minds out there.  :wink:
AutoLISP (Vanilla / Visual) / Dimensioning objects from selection set - Stumped!
« Last post by QuicklyCAD on September 30, 2020, 10:02:23 PM »
Hi all,
I've benefited tons from the site in the past, but this is my first post.  I'm in need of some assistance in solving a LISP puzzle that has been driving me crazy.
I created a simple routine that gathers objects (lines and arcs) into a selection set and then adds dimensions to the objects.  This routine worked perfectly when I wrote it, but in the days since it has stopped working consistently and I have exhausted my knowledge in trying to figure out why.  It now fails at the point where the dimension command attempts to select the object in the SS.  Occasionally it will proceed through the routine successfully but the majority of the time it now fails. If anyone has any insight I would greatly appreciate it!  Code inserted below.

Code - Auto/Visual Lisp: [Select]
  1. (defun c:sds (/ ss i obj vlObj ent pt dObj)
  2.   (princ "\nSelect Boundaries: ")
  3.   (setq ss (ssget '((8 . "PP - Boundary")))
  4.         i 0)
  5.   (repeat (sslength ss)
  6.     (setq obj (ssname ss i)
  7.           vlObj (vlax-ename->vla-object obj)
  8.           ent (entget obj))
  9.     (cond
  10.       ((= (cdr (assoc 0 ent)) "LINE")
  11.        (setq pt (cdr (assoc 10 ent)))
  12.        (command "dimaligned" "" obj pt))
  13.       ((= (cdr (assoc 0 ent)) "ARC")
  14.        (command "dimarc" obj pt))
  15.       );cond
  16.        (setq dObj (vlax-ename->vla-object (entlast)))
  17.        (vlax-put-property dObj 'Layer "PP - Dims - Site")
  18.        (vlax-put-property dObj 'StyleName "Site Dims")
  19.     (setq i (+ i 1))
  20.     );repeat
  21.   )
.NET / Re: System Variable Dialog Box
« Last post by jtoverka on September 30, 2020, 08:27:55 PM »
"set drawing variables to my preferences"

Why not just set them to what you want why do you need a dcl ?

You can create various functions to suit that have different system settings.

I already have an implementation in AutoLISP. It's not graphical, just some setvars. I am talking about drawing stored system variables. Not all drawings have the same settings and it's really annoying. Like I will open a drawing that has a different clayer, celtype, celweight and it gets in my way when I create objects. I want to see all possible variables, their description, and whether or not to set a default preference when I open a drawing.

This is especially true when aunits and auprec is not what I want. I HATE architectural units with a passion. I want decimals to 8 places. Again, I have an implementation in AutoLISP. I just want a really good implementation in .NET.
Pages: [1] 2 3 ... 10