Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Object Properties

5 REPLIES 5
Reply
Message 1 of 6
gccdaemon
437 Views, 5 Replies

Object Properties

I'm trying to create an autolisp routine to standardize details that i get from different city/state entities. Currently it takes about 10-15 minutes per detail and i have some 1,000+ details to convert this way. I can do a majority of the work with basic macros, but where i'm having problems is with filtering selection sets based on properties of objects, and changing those properties. Plus, does anyone have a list of object specific group codes?

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: gccdaemon


@gccdaemon wrote:

.... does anyone have a list of object specific group codes?


There may be an equivalent from some newer version(s), but I have used this that I ran across long ago and found it very useful, most of which at least will still be applicable.

 

EDIT:

By golly, there is a place to get the DXF codes for any release back to 13, here.

Kent Cooper, AIA
Message 3 of 6
BlackBox_
in reply to: gccdaemon


@gccdaemon wrote:

I'm trying to create an autolisp routine to standardize details that i get from different city/state entities. Currently it takes about 10-15 minutes per detail and i have some 1,000+ details to convert this way. I can do a majority of the work with basic macros, but where i'm having problems is with filtering selection sets based on properties of objects, and changing those properties. Plus, does anyone have a list of object specific group codes?


Have you considered employing ObjectDBX instead of manually (or by script) modifying the external detail drawings?

 

ObjectDBX is not able to work with selection sets, and there are some other limitations, but it sounds as though (and I could be mistaken) that you're simply 'standardizing' (i.e., text goes on this layer, lines on that, etc.) for the purposes of inserting your details with consistent contents... ObjectDBX *can* be a fantastic tool for this purpose, and can process a directory of drawings in less time than you could manually process a few (for me it's usually only seconds for the entire lot).

 

Perhaps more information would help... If it's not overly complex, I might code it for you; at minimum I can point you toward many ObjectDBX implementations that you might try culling.

 

Cheers



"How we think determines what we do, and what we do determines what we get."

Message 4 of 6
gccdaemon
in reply to: BlackBox_

Anything that would be faster than what i'm doing would be great, although there are extra commands that I'm going to use that i don't think DBX can do. Most of the drawings i'm dealing with are exported from microstation. I'm not sure if that's going to affect anything. Here is a list of what i'm trying to do in order.

 

1. Load/Created Arial and RomanS Text styles

2. Load HIDDEN3, CENTER3, PHANTOM3, AND DASHDOT3 linetypes from ACAD.LIN

3. Explode all objects to base objects, including dims, blocks, etc. MText can stay, but needs to have formatting removed.

4. delete points

5. Flatten everything to 0 elevation/"Z" value

6. Change all objects to 0 layer

7. Change all lineweights to bylayer

8. Change all text/mtext to Arial

9. change objects on colors bylayer & white to byblock

10. Change objects on all other colors to 253

11. Change objects with byblock and continuous linetypes to bylayer

12. Change all objects not on bylayer to appropriate linetype loaded earlier (microstation linetypes are everywhere and don't have room to list them to what i want to change them to)

13. Move all objects to 0,0,0

14. Scale all objects with reference points to 7" height

 

Like I said, a lot of this can be done with macro, but the filtering has got me stalled. A Lisp would probably be better because it's easier to distribute to the other CAD guys. Also a lot of these details have been added to a file as blocks and are referenced into a detail palette for insterion into plan sets.

 

Andrew Ingram
Civil 3D x64 2019
Win 10 x64 Pro
Intel Xeon E5-1620
32 GB Ram
Message 5 of 6
smaher12
in reply to: gccdaemon

This should cover 1,2,3,4,6, & 7

 

(defun C:tmp ()

  (foreach ts '("Arial" "RomanS")
    (if (not (tblsearch "style" ts))
      (command "-style" ts ts "" "" "" "" "" "")
      ); end if
    ); end foreach

  (foreach lt '("Hidden" "Center" "Phantom" "Dashdot")
    (if (not (tblsearch "ltype" lt))
      (command "_.-linetype" "_l" lt "acadiso.lin" "")
      ); end if
    ); end foreach

  (if (setq ss (ssget "_X"))
    (progn
      (command "chprop" ss "" "la" "0" "lw" "bylayer"  "")

       (if (setq ss1 (ssget "_P" '((0 . "DIMENSION,INSERT,*POLYLINE,MLINE"))))
	 (foreach item (mapcar 'cadr (ssnamex ss1))
	   (command "explode" item)
	   (if (setq ss4 (ssget "_P"))
	     (progn
	       (command "chprop" "_P" "" "la" "0" "lw" "bylayer"  "")
	       (setq ss4 nil)
	     );; progn
	   );; if
	 );;foreach
       );; if
    );; progn
  );; if

  (if (setq ss (ssget "_X" '((0 . "POINT"))))
    (command "erase" ss "")
  );; if
)

 

Message 6 of 6
devitg
in reply to: gccdaemon

If you can upload a before ,as it come from microstation, and a after, as it end when you did all step , will be easy to help.

You can send it offline to the attached e-mail addres  

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost