satishrajdev Posted April 24, 2013 Posted April 24, 2013 I have a routine which i use to insert xyz data, sometime if the data is heavy my routine takes time to insert blocks according to data, so i want to use ENTMAKE instead of INSERT function, so, i can plot the data more faster that INSERT function. My code is given below:- (command "_insert" Soundings "_scale" Bsl "_non" ipt 0 xs ys "_CHPROP" (entlast) "" "_C" theColor "") ) can anyone guide me to convert it into ENTMAKE function Thankx in advance:) Quote
prakashreddy Posted April 24, 2013 Posted April 24, 2013 If you are inserting blocks, how you are changing the color? To insert the blocks see below code. (defun Insert_sc (pt Nme sc) (entmakex (list (cons 0 "INSERT") (cons 2 Nme) (cons 10 pt) (cons 41 sc) (cons 42 sc) (cons 43 sc))) ) pt : insertion point Nme : Block Name Sc : scale Quote
MSasu Posted April 24, 2013 Posted April 24, 2013 The color is controlled by DXF code 62. Alternatively may set the CECOLOR system variable to the desired value before adding the entities. Please keep in mind that a good programming practice is to restore it after. Quote
prakashreddy Posted April 24, 2013 Posted April 24, 2013 The color is controlled by DXF code 62.Alternatively may set the CECOLOR system variable to the desired value before adding the entities. Please keep in mind that a good programming practice is to restore it after. In my view, if you changing the color of the block, there won't be any change in visbility. Quote
satishrajdev Posted April 25, 2013 Author Posted April 25, 2013 I tried but still no result, my code is:_ (defun Insert_sc () (entmake (list '(0 . "INSERT") '(66 . 1); has attribute(s) (cons 2 Soundings);ock name (cons 10 ipt);insertion point (cons 41 Bsl); X (cons 42 Bsl); Y (cons 43 Bsl); Z ) ) (entmake (list '(0 . "ATTRIB") (cons 2 xs) ) ) (entmake '((0 . "SEQEND"))) ) If there is a more than 1 attribute tag in a block then what is DXF code we should use for that e.g. If there is tag xs and ys then plz provide DXF code for multiple attribute tag Quote
Costinbos77 Posted April 25, 2013 Posted April 25, 2013 (edited) Insertion coordinates are required ! IPT variable must be the 3D point : (x y z) (entmake (list '(0 . "INSERT") (cons 2 Soundings) (cons 8 layer) '(66 . 1) ; '(2 . "BlockName") [color=red] (list 10 x y z)[/color] (cons 41 Bsl) (cons 42 Bsl) (cons 43 Bsl) ) ) . . . (entmake (list '(0 . "ATTRIB") [color=red]'(10 0 0 0)[/color] (cons 8 layer) (cons 1 "text") (cons 2 xs) ;'(2 . "AttDescr") [color=red](cons 40 ht)[/color] '(70 . 0) '(7 . "Arial")[color=red] (list 11 xa ya za)[/color] '(72 . 0) '(74 . 2)) ) Because "ATTRIB" is like a "TEXT" entity. Edited April 26, 2013 by Costinbos77 Quote
Lee Mac Posted April 25, 2013 Posted April 25, 2013 Since Attribute References (ATTRIBs) are considered separate from a Block Definition (BLOCK) (this is to enable several Block References to hold different attribute values), when using entmake[x] to create a Block Reference (INSERT) you will also need to entmake[x] the necessary accompanying Attribute References (ATTRIBs). Each Attribute Reference (ATTRIB) will need to be positioned relative to insertion point of the Block Reference (INSERT), based on both the position of the Attribute Definition (ATTDEF) relative to the origin (INSBASE - DXF Group 10) of the Block Definition (BLOCK), and taking into account the position, scale, rotation & orientation of the inserted Block Reference (INSERT); (You can construct a transformation matrix to perform this necessary transformation). The scale (i.e. text height), rotation & normal will also need to reflect such properties of the associated Block Reference (INSERT). You will also need to match every property of the Attribute Definition (ATTDEF) when using entmake[x] to create the Attribute Reference (ATTRIB), (e.g. justification, layer, colour, rotation (relative to the block definition), width factor etc.). Given the amount of code required to correctly entmake[x] an Attributed Block Reference, it is generally easier to use the Visual LISP ActiveX insertblock method which generates the Attribute References (ATTRIBs) automatically, populated with the default Attribute Definition (ATTDEF) values. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.