Jump to content

Leaderboard

Popular Content

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

  1. Try this you need to save the Multi Radio buttons.lsp to a support path for it to work can be used in any program will work with up to about 20 xref names. If you have more then 20 need to use a listbox library routine see Lee-mac.com. (defun choosexref ( / lst doc blocks n but) (vl-load-com) (setq lst '()) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (setq blocks (vla-get-Blocks doc)) (vlax-for n blocks (if (eq (vla-get-IsXref n) :vlax-true) (progn (setq xname (vl-string-translate (chr 92) (strcat (chr 92)(chr 92)) (vla-get-path n))) (setq lst (cons xname lst)) ) ) ) (setq lst (cons "Please choose xref" lst)) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (if (= but nil)(setq but 1)) (setq xrsel (ah:butts but "V" lst)) (princ) ) Multi radio buttons.lsp
    2 points
  2. Here's a quick (untested) adaption of your code to integrate a call to my LM:listbox function: (defun c:formatxr ( / cmd def lst ) (while (setq def (tblnext "block" (not def))) (if (= 4 (logand 4 (cdr (assoc 70 def)))) (setq lst (cons (cdr (assoc 2 def)) lst)) ) ) (if lst (progn (setq cmd (getvar 'cmdecho)) (setvar 'cmdecho 0) (foreach xrf (LM:listbox "Select Xrefs to Format" (acad_strlsort lst) 1) (command "_.-layer" "_color" 252 (strcat xrf "|*") "_pstyle" "Shade 50%" (strcat xrf "|*") "_color" 150 (strcat xrf "|C-PVMT-ASPH," xrf "|C-PVMT-CONC," xrf "|C-PVMT-GRVL") "_freeze" (strcat xrf "|X-TOPO-TEXT") "" ) ) (setvar 'cmdecho cmd) ) (princ "\nNo xrefs are defined in the active drawing.") ) (princ) )
    1 point
  3. Rather than iterating over the entire Layers Collection to rename a single layer, you can obtain it directly using tblobjname, e.g.: (defun c:layren ( / enx obj old new ) (setq old "Layer_to_be_Renamed" new "New_Layer_Name" ) (if (and (setq obj (tblobjname "layer" old)) (setq enx (entget obj)) ) (entmod (subst (cons 2 new) (assoc 2 enx) enx)) ) (princ) )
    1 point
  4. Does it have to be an AutoDesk product? There are less expensive options such as BricsCAD, nanoCAD and Draftsight. Each of these is an AutoCAD clone capable of reading and writing to the .DWG format. Just asking.
    1 point
  5. Have you thought about organizing your drawings differently? IMO, some of these problems could be avoided.
    1 point
  6. You probably could find some good deals somewhere on the internet. Just be prepared to say goodbye to your money because they will be cons. Autocad is available either directly through their site or through a reseller that you can find via the Autodesk site and yes at the moment subscription is your only option. Of course there are plenty of alternative CAD programs on the market and a quick google search will show you these
    1 point
  7. This should be the missing part you need to finish the goal of your program and I am sure that you do the rest part for lines. ;; where variables: ;; ;; obj = Green Polyline. ;; ;; lst = list of intersected points. ;; ;; srt = sorted points to use to create lines in order. ;; (foreach pt lst (setq pts (cons (vlax-curve-getdistatpoint obj (vlax-curve-getclosestpointto obj pt)) pts)) ) (setq srt (vl-sort pts '(lambda (j k) (< j k))))
    1 point
×
×
  • Create New...