satishrajdev 发表于 2022-7-6 02:35:16

快速插入法

大家好,
 
我只是想知道,插入以下属性块的最快方法是什么:-
1.(命令“插入”……)
 
2.vla插入块
 
3.Entmake
 
我想让它插入我的测深数据,有时有500多个点。。。。。
 
目前,我正在使用上述第一个选项通过lisp插入块。。。。。但如果数据文件包含500多个点,则需要花费太多时间。。。

GP_ 发表于 2022-7-6 02:43:21

我认为entmake更快。
 
块定义:

   (if (null (tblsearch "BLOCK" "TesT"))
       (progn
         ;block header definition:
         (entmake '((0 . "BLOCK")(2 . "TesT")(70 . 2)(10 0.0 0.0 0.0)))
         ;object definition (point)
         (entmake '((0 . "POINT")(8 . "Layer1")(10 0.0 0.0 0.0)(210 0.0 0.0 1.0)(50 . 0.0)))
         ;attribute definition
         (entmake
               '((0 . "ATTDEF")(8 . "Layer2")(10 0.25 -0.5 0.0)(1 . "")(2 . "tag")
               (3 . "prompt")(40 . 0.4)(41 . 0.(50 . 0.0)(70 . 0)(71 . 0)(72 . 0)(73 . 2)
               (7 . "arial"))
         )
         ;end block definition
         (entmake '((0 . "ENDBLK")))
       )
   )

 
块插入:

   (entmake
       (list
         (cons 0 "INSERT")(cons 100 "AcDbEntity")(cons 67 0)(cons 410 "Model")
         (cons 8 "Layer1")(cons 100 "AcDbBlockReference")(cons 66 1)(cons 2 "TesT")
         (cons 10 (list 0 0 0))(cons 41 1)(cons 42 1)(cons 43 1)
       )
   )
   (entmake
       (list
         (cons 0 "ATTRIB")(cons 100 "AcDbEntity")(cons 8 "Layer2")
         (cons 100 "AcDbText")(cons 10 (list 0.4 0.5 0))(cons 40 0.4)(cons 41 0.85)
         (cons 1 "ATT_TEXT")(cons 7 "arial")(cons 100 "AcDbAttribute")
         (cons 2 "tag")(cons 70 (cons 39 0)
       )
   )
   (entmake (list (cons 0 "SEQEND")))

 
查看帮助(DXF参考)

Lee Mac 发表于 2022-7-6 02:53:51

一般来说,entmake生成实体的速度最快,但是,使用entmake插入属性块可能是一件痛苦的事情,因为您还需要将每个ATTRIB实体输入,这涉及基于位置、比例、方向和旋转计算每个ATTRIB实体相对于块参考(插入)的位置、比例、方向和旋转,关联ATTDEF图元相对于块定义的旋转和方向,以及块参照本身的位置、比例、旋转和方向。
 
相比之下,ActiveX insertblock方法可以为您解决这一问题,而不会造成性能上的不利损失

satishrajdev 发表于 2022-7-6 02:57:27

非常感谢你们俩。。。。我正在学习entmake函数。。。。。如果我有任何疑问,我会回到你身边……)

satishrajdev 发表于 2022-7-6 03:08:25

我正在尝试制作属性块。。。。
 
它正在创建属性和圆,但不是将其作为块。。。。
 
(if (not (tblsearch "BLOCK" "Bathymetry"))
(progn
   (entmake
   (list
(cons 0 "BLOCK")
(cons 2 "Bathymetry")                ;Specify block name
(cons 8 "BATHY")                ;Layer name
(cons 100 "AcDbEntity")
(cons 100 "AcDbBlockReference")
(cons 410 "Model")
(cons 10 '(0 0 0))                ;Insertion point
(cons 66 1)                        ;Attribute flag
(cons 67 0)
(cons 71 0)
   )
   )
   (entmake
   (list
(cons 0 "CIRCLE")
(cons 8 "FIX-CO")                ;Layer
(cons 10 '(0 0 0))                ;Insertion point
(cons 40 0.0872)                ;Radius
   )
   )
   (entmake
   (list
(cons 0 "ATTDEF")
(cons 8 "BATHY")                ;Layer
(cons 1 "X")                        ;Value
(cons 2 "X")                        ;Tag
(cons 3 "X")                        ;Prompt
(cons 7 "ROMANS")                ;Textstyle
(cons 10 (LIST -0.0107 -0.0861 0.0)) ;Insertion point
(cons 40 1)                        ;Text height
(cons 41 0.7)                        ;Width factor
                                ;(cons 51 1) ;Oblique angle
(cons 70                         ;Attribute flag
(cons 71 2)                        ;Text generation flags
   )
   )
   (entmake
   (list
(cons 0 "ATTDEF")
(cons 8 "BATHY")                ;Layer
(cons 1 "Y")                        ;Value
(cons 2 "Y")                        ;Tag
(cons 3 "Y")                        ;Prompt
(cons 7 "ROMANS")                ;Textstyle
(cons 10 (LIST -0.1311 -0.5713 0.0)) ;Insertion point
(cons 40 0.73)                        ;Text height
(cons 41 0.7)                        ;width factor
                                ;(cons 51 1) ;Oblique angle
(cons 70                         ;Attribute flag
   )
   )
   (entmake '((0 . "ENDBLK")
       (100 . "AcDbBlockEnd")
       (8 . "0")
      )
   )
)
)

GP_ 发表于 2022-7-6 03:12:03

看看帖子#2
 
-块定义
-块插入

satishrajdev 发表于 2022-7-6 03:16:50

尊敬的GP:_
 
参考你的邮件,我创建了我的代码。。。。如上所述
 
但仍然不知道它有什么问题,没有正确创建块
 
你能查一下我的密码吗

gS7 发表于 2022-7-6 03:22:16

>>萨提斯拉杰夫
 
请尝试以下代码并根据您的要求修改代码
 
(defun c:check ()

(if (not (tblsearch "BLOCK" "Bathymetry"))
   (progn
   (entmake
(list
(cons 0 "BLOCK")
(cons 2 "Bathymetry")
(cons 70 2)
(cons 10 '(0. 0. 0.))
)
   )

   (entmake (list (cons 0 "CIRCLE")
             (cons 10 '(0.0 0.0 0.0))
             (cons 40 0.0872)
             (cons 8 "FIX-CO")
       )
   )

   (entmake
(list
(cons 0 "ATTDEF")
(cons 8 "BATHY")
(cons 10 '(-0.0107 -0.0861 0.0))
(cons 70
(cons 1 "X")
(cons 2 "X")
(cons 3 "X")
(cons 41 0.7)
(cons 71 2)
(cons 280 1)
(cons 40 1.0)
)
   )

   (entmake
(list
(cons 0 "ATTDEF")
(cons 8 "BATHY")
(cons 10 '(-0.1311 -0.5713 0.0))
(cons 70
(cons 1 "Y")
(cons 2 "Y")
(cons 3 "Y")
(cons 41 0.7)
(cons 71 2)
(cons 280 1)
(cons 40 0.73)
)
   )

   (entmake
(list
(cons 0 "ENDBLK")
(cons 8 "Your layer Name")
)
   )
   )
)

(entmake
   (list
   (cons 0 "INSERT")
   (cons 2 "Bathymetry")
   (cons 10 '(0 0 0))
   (cons 66 1)
   )
)
(entmake
   (list
   (cons 0 "ATTRIB")
   (cons 10 '(0 0 0))
   (cons 1 "X")
   (cons 2 "X")
   (cons 40 2.0)
   (cons 70 0)
   (cons 8 "0")
   (cons 280 1)
   )
)
(entmake
   (list
   (cons 0 "ATTRIB")
   (cons 10 '(2 0 0))
   (cons 1 "Y")
   (cons 2 "Y")
   (cons 40 2.0)
   (cons 70 0)
   (cons 8 "0")
   (cons 280 1)
   )
)


(entmake
   (list
   (cons 0 "SEQEND")
   )
)
)

satishrajdev 发表于 2022-7-6 03:33:22

砰的一声。。。。。。。。。。。。。。。谢谢Ganesh:thumbsup:

gS7 发表于 2022-7-6 03:35:36

最受欢迎的satishrajdev
很乐意帮忙
页: [1]
查看完整版本: 快速插入法