Author Topic: Looking for ALL variables that infuence entmake(x)  (Read 1641 times)

0 Members and 1 Guest are viewing this topic.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Looking for ALL variables that infuence entmake(x)
« on: March 22, 2012, 09:37:51 AM »
No doubt many of you know that (entmake) will work with very short entity lists:
Code - Auto/Visual Lisp: [Select]
  1. (entmake '((0 . "CIRCLE") (10 0 0 0) (40 . 1)))
But the result will then depend on a number of drawing variables.

Below is a list of those variables, together with their default values. My question is: is this list complete or are there more variables? The list will of course be CAD program/version dependent (current Autocad has some 1000? variables and current Bricscad ca. 700).
Code - Auto/Visual Lisp: [Select]
  1. '(
  2.   (clayer "0")
  3.   (cecolor "ByLayer")
  4.   (celtscale 1)
  5.   (celtype "ByLayer")
  6.   (celweight -1)
  7.   (cmaterial "")
  8.   (cplotstyle "ByLayer")
  9.   (thickness 0)
  10. )
« Last Edit: March 22, 2012, 09:42:37 AM by roy_043 »

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: Looking for ALL variables that infuence entmake(x)
« Reply #1 on: March 23, 2012, 01:48:06 AM »
I think you've got the gist of the common properties.

What about Elevation - you'd think that would change the Z value (it doesn't even if your point only has X & Y), though with polylines it has an effect. For that matter, UCS settings? UCSOrg, UCSXDir, UCSYDir. Again only influences some entities.

What about things like text style, dim, mleader, etc.? Some of those will fail if left out in entmake, but if you use the ActiveX vla-Add*** then the current settings gets used. I think it becomes an inexhaustible list - what about custom objects (like AEC stuff)?

I suppose your question is one of those: "How long is a string?" type questions.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Looking for ALL variables that infuence entmake(x)
« Reply #2 on: March 23, 2012, 04:47:34 AM »
Elevation:
I don't see an effect even with polylines. The code below creates a polyline with a zero elevation (gc 38) irrespective of the current elevation setting.
Code: [Select]
(entmake '((0 . "LWPOLYLINE") (70 . 1) (10 0 0) (10 0 1) (10 1 0)))
UCS settings:
I don't know of any effect of the current UCS on the (entmake) process. Do you have an example?
There is an influence on (vla-add*) functions though.
Code: [Select]
(vla-addcircle (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) '(0 0 0) 1)The Z-axis of the current UCS is used for the extrusion direction of the circle.

Styles:
You are right that styles should also be considered. This will create a text with the current textstyle:
Code: [Select]
(entmake '((0 . "TEXT") (10 0 0 0) (40 . 1) (1 . "test")))
Inexhaustible list/Limiting the list:
Maybe it is a good idea to limit the list to groupcodes that are omitted from (entget) entitylists if they have a default value. This will shorten the list in my first post as clayer should then be removed.

Some background information:
I have been using the code principle below to clone entities. But of course the clone can 'pick up' some of the current drawing variables, leading to unpredictable results.
Code: [Select]
(setq lst (entget (car (entsel))))
(entmake lst)