Author Topic: DLEDIT v.1 (Line type Editor) !  (Read 9890 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
DLEDIT v.1 (Line type Editor) !
« on: December 26, 2008, 12:23:43 AM »
Well,..

After making Dhatch (Dynamic Hatch)....i've decided to make Dynamic Line Editor..
why not ?  :laugh:

there it is.....

DLEDIT v. 1



Enjoy !


Keep smile...

stevesfr

  • Newt
  • Posts: 54
Re: DLEDIT v.1 (Line type Editor) !
« Reply #1 on: December 26, 2008, 07:46:56 AM »
Nice work  :lol:

Future work possibilities: Dynamic Fillet,  Dynamic pline width, Dynamic "box" around text entities (complete with possible Dynamic pline width shaddow? )  of course let's not forget color change option !!
Happy programmin'.
steveo
Can't remember what I'm supposed to forget.

Biscuits

  • Swamp Rat
  • Posts: 502
Re: DLEDIT v.1 (Line type Editor) !
« Reply #2 on: December 26, 2008, 09:10:17 AM »
Very nice work!

GDF

  • Water Moccasin
  • Posts: 2081
Re: DLEDIT v.1 (Line type Editor) !
« Reply #3 on: December 26, 2008, 10:07:25 AM »
You are on a roll here, good work and thanks for sharing.

I get the following error when I try to use (L) Line type
error: no function definition: AI_TABLE

but the ai_utils.lsp file is loaded.
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: DLEDIT v.1 (Line type Editor) !
« Reply #4 on: December 26, 2008, 10:12:51 AM »
Great, another way for users to hard code properties.

I salute your industriousness Andrea but have to shake my head at apps that encourage bad CAD practices, no matter the glitz.

Slips into comfortable flame retardant suit.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

GDF

  • Water Moccasin
  • Posts: 2081
Re: DLEDIT v.1 (Line type Editor) !
« Reply #5 on: December 26, 2008, 10:21:31 AM »
Michael

I agree, hard coding of color is very bad practice. This becomes a problem when you want to gray out a
backgound that is xrefed in...if the color is not bylayer, the gray out will not work for that layer.
« Last Edit: December 26, 2008, 10:40:47 AM by GDF »
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Andrea

  • Water Moccasin
  • Posts: 2372
Re: DLEDIT v.1 (Line type Editor) !
« Reply #6 on: December 26, 2008, 11:12:35 AM »
GDF..

ai_table replaced !

Thanks  :roll:

MP,...i'm not sure realy if i understand..
what do you mean by "hard coding color" ?

« Last Edit: December 26, 2008, 11:28:56 AM by Andrea »
Keep smile...

GDF

  • Water Moccasin
  • Posts: 2081
Re: DLEDIT v.1 (Line type Editor) !
« Reply #7 on: December 26, 2008, 11:48:20 AM »
GDF..

ai_table replaced !

Thanks  :roll:

MP,...i'm not sure realy if i understand..
what do you mean by "hard coding color" ?



See my comment above...when the color is not bylayer...it is hard coded
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Andrea

  • Water Moccasin
  • Posts: 2372
Re: DLEDIT v.1 (Line type Editor) !
« Reply #8 on: December 26, 2008, 12:25:33 PM »
could you provide any screenShot please ?

I've made some test with diffrent backgroud color
and didn't see any problem...
Keep smile...

GDF

  • Water Moccasin
  • Posts: 2081
Re: DLEDIT v.1 (Line type Editor) !
« Reply #9 on: December 26, 2008, 12:40:55 PM »
could you provide any screenShot please ?

I've made some test with diffrent backgroud color
and didn't see any problem...

See pic below. This is an xref file with all of the xref layers in the current model space changed to color 8
the background color for the xref. You will notice the red and yellow block within the xref file that has the
layer color hard coded and not bylayer.

The code below is used to change the xrefed file to color 8 which is our screened color used to subdue
the xref file so that lines, text and dimensions stand out in the current model space (not shown in this pic)

Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun XREF-28-29IT  (/ tmp)
  (initget "8 9")
  (setq tmp (getkword "\n* Pick Xref Layer Color:  <8> Color   <9> Color *"))
  (cond ((= tmp "8") (XREF28IT))
        ((= tmp "9") (XREF29IT)))
  (princ))
;;;Routine to set all model space Xref ;layers to color 9
;;;by Jeff Mishler, 5/3/03
(defun XREF28IT  (/ ssblk cnt blknames lay ename)
  (setq ssblk (ssget "x" '((0 . "INSERT") (410 . "Model"))))
  (setq cnt 0)
  (setq blknames "")
  (repeat (sslength ssblk) ; create list of block names in Model space for filter list
    (setq blknames (strcat blknames (cdr (assoc 2 (entget (ssname ssblk cnt)))) "|*,"))
    (setq cnt (1+ cnt)))
  (setq lay (tblnext "layer" t)) ;get layer entity
  (command "undo" "be")
  (while (/= lay nil)
    (if (wcmatch (cdr (assoc 2 lay)) blknames) ;find xref layers, could use assoc 70 instead
      (progn (setq ename (tblobjname "layer" (cdr (assoc 2 lay))))
             (setq lay (entget ename))
             (if (> (cdr (assoc 62 lay)) 0) ; is the layer on?
               (setq lay (subst (cons 62 8) (assoc 62 lay) lay)) ; yes it is
               (setq lay (subst (cons 62 -8) (assoc 62 lay) lay)) ; no, it's off
               )
             (entmod lay)))
    (setq lay (tblnext "layer")) ; next layer
    )
  (if ename
    (prompt
      "\n* All Xref Layers in Model space except \"0\" and \"defpoints\" now color 8! *")
    (prompt "\n* No xref layers found in Model Space! *"))
  (command "undo" "end")
  (princ))
(defun XREF29IT  (/ ssblk cnt blknames lay ename)
  (setq ssblk (ssget "x" '((0 . "INSERT") (410 . "Model"))))
  (setq cnt 0)
  (setq blknames "")
  (repeat (sslength ssblk) ; create list of block names in Model space for filter list
    (setq blknames (strcat blknames (cdr (assoc 2 (entget (ssname ssblk cnt)))) "|*,"))
    (setq cnt (1+ cnt)))
  (setq lay (tblnext "layer" t)) ;get layer entity
  (command "undo" "be")
  (while (/= lay nil)
    (if (wcmatch (cdr (assoc 2 lay)) blknames) ;find xref layers, could use assoc 70 instead
      (progn (setq ename (tblobjname "layer" (cdr (assoc 2 lay))))
             (setq lay (entget ename))
             (if (> (cdr (assoc 62 lay)) 0) ; is the layer on?
               (setq lay (subst (cons 62 9) (assoc 62 lay) lay)) ; yes it is
               (setq lay (subst (cons 62 -9) (assoc 62 lay) lay)) ; no, it's off
               )
             (entmod lay)))
    (setq lay (tblnext "layer")) ; next layer
    )
  (if ename
    (prompt
      "\n* All Xref Layers in Model space except \"0\" and \"defpoints\" now color 9! *")
    (prompt "\n* No xref layers found in Model Space! *"))
  (command "undo" "end")
  (princ))
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

Andrea

  • Water Moccasin
  • Posts: 2372
Re: DLEDIT v.1 (Line type Editor) !
« Reply #10 on: December 26, 2008, 01:18:05 PM »
oh..OK..

Well I agree,...But the code written isn't for block or for Xref..
sorry,..

future version..maybe ?
you can take also look to LAYLOCKFADECTL variable..
maybe this can be useful..

for the moment i've added PLINEWIDTH option.

Keep smile...

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: DLEDIT v.1 (Line type Editor) !
« Reply #11 on: December 26, 2008, 01:37:51 PM »
MP,...i'm not sure realy if i understand..
what do you mean by "hard coding color" ?

Generally speaking, it is considered bad practice to hard code properties, that is, specifying anything other than bylayer or byblock for colors, line types, line weights ad nauseum. Some of the glitzy apps you've been penning lately, while having visual appeal to the uninformed, are pretty much encouraging users to use AutoCAD in a way most CADD managers have spent years trying to thwart. Before labeling me a malcontent wear the shoes of a CADD janitor who has cleaned up tens of thousands of drawings far too many times because people fail to follow instructions and / or use tools that encourage said bad practices.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: DLEDIT v.1 (Line type Editor) !
« Reply #12 on: December 26, 2008, 02:15:28 PM »
MP,...i'm not sure realy if i understand..
what do you mean by "hard coding color" ?

Generally speaking, it is considered bad practice to hard code properties, that is, specifying anything other than bylayer or byblock for colors, line types, line weights ad nauseum. Some of the glitzy apps you've been penning lately, while having visual appeal to the uninformed, are pretty much encouraging users to use AutoCAD in a way most CADD managers have spent years trying to thwart. Before labeling me a malcontent wear the shoes of a CADD janitor who has cleaned up tens of thousands of drawings far too many times because people fail to follow instructions and / or use tools that encourage said bad practices.

Not forgetting about having a "proper" linetype/hatch scale set by the project or client standard.  For standardized CAD applications these may not be the best of tools, but it is a good intellectual exercise and examples of how to make use of (grread...).  It might be better to think of these as "engineers sketchbook" tools for quickly whacking out some quality electronic sketches instead of the normal scribbles we see at the start of projects.

Now that I think about it, I might add a sketching profile to our standard system using these sort of tools...
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

GDF

  • Water Moccasin
  • Posts: 2081
Re: DLEDIT v.1 (Line type Editor) !
« Reply #13 on: December 26, 2008, 02:37:51 PM »
MP,...i'm not sure realy if i understand..
what do you mean by "hard coding color" ?

Generally speaking, it is considered bad practice to hard code properties, that is, specifying anything other than bylayer or byblock for colors, line types, line weights ad nauseum. Some of the glitzy apps you've been penning lately, while having visual appeal to the uninformed, are pretty much encouraging users to use AutoCAD in a way most CADD managers have spent years trying to thwart. Before labeling me a malcontent wear the shoes of a CADD janitor who has cleaned up tens of thousands of drawings far too many times because people fail to follow instructions and / or use tools that encourage said bad practices.



Not forgetting about having a "proper" linetype/hatch scale set by the project or client standard.  For standardized CAD applications these may not be the best of tools, but it is a good intellectual exercise and examples of how to make use of (grread...).  It might be better to think of these as "engineers sketchbook" tools for quickly whacking out some quality electronic sketches instead of the normal scribbles we see at the start of projects.

Now that I think about it, I might add a sketching profile to our standard system using these sort of tools...


You hit the nail on the head. Hatch and Linetype scale should be part of a standardized setup. Instead of mousing a scale, it would be better to
enter in a value at the command line.

Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

stevesfr

  • Newt
  • Posts: 54
Re: DLEDIT v.1 (Line type Editor) !
« Reply #14 on: December 26, 2008, 03:58:33 PM »
Andrea, please chk the file, width option not working here in v2008 for some reason on a pline.
thx.
Keep up the fine work.  For a one man shop, we can choose to use whatever setup is needed for our work, which is mostly one drawing finish projects anyway.  Client doesn't know a CAD drawing from a spreadsheet and never gets the dwg file anyway.  He just flips when it looks 'the way he envisioned'.   
Can't remember what I'm supposed to forget.