Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Why can't show up entirely???

10 REPLIES 10
Reply
Message 1 of 11
2e4lite
365 Views, 10 Replies

Why can't show up entirely???

  When I use the command of regen in opening some layers ( not all) condition, then I switch to other layers , the objects  of  the whole drawing are not show up, I must to use the re again to show up,but I don't want to use it every time.How to show it up automatically?(ps: cad2009; the objects is all 2d;the  condition as the grapic to following)

10 REPLIES 10
Message 2 of 11
braudpat
in reply to: 2e4lite

 

Hello

 

Maybe you have display problems linked to your graphic card and its driver !

Have you the problem in the Model Space and/or in Layouts ?

You could try : _REGENALL

 

An other idea : have you installed the SP 3 on your ACAD 2009 ?

http://knowledge.autodesk.com/support/autocad/downloads/caas/downloads/content/autocad-2009-update-3...

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 3 of 11
Kent1Cooper
in reply to: 2e4lite

Try turning automatic Regeneration on, either:

 

REGENAUTO command [turn On]

 

or

 

(setvar 'regenmode 1)

Kent Cooper, AIA
Message 4 of 11
2e4lite
in reply to: braudpat

   Thank you for the reply! It is  in the Model Space,the REGENAUTO is on and regenmode is 1,but can't show it up automatically.I tested in another computer and also cad2009,installed the sp3,the result is the same.Incidentally,When tested in cad2004 ,This problem does not occurs, at least not yet found.

Message 5 of 11
2e4lite
in reply to: 2e4lite

Who can explain what is the reason

Message 6 of 11
braudpat
in reply to: 2e4lite

 

Hello

 

With ACAD 2009 + SP3 , you always have the problem !

and with ACAD 2004, you don't have ...

So please can you share with us a DWG (in ZIP format) which has the problem ?

and please draw a few red circles where the problem(s) is/are !

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 7 of 11
2e4lite
in reply to: braudpat

Thanks braudpat !

I have resolved it myself : I'm in the  function to following with the regen command, but another problem occurs,I feel the program is too slow, can make it quickly?  The Sortents is set 112, right?  Thank you!

 

  

Message 8 of 11
braudpat
in reply to: 2e4lite

 

Hello

 

I haven't any PC around me with such an old ACAD version !

 

But I think that SORTENTS = 127 is the right value !?

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 9 of 11
2e4lite
in reply to: braudpat

  I have to use the command(regen) to display the objects, but by using it, the operation will become very slow.After I SET SORTENTS = 127 ,I  can't see what is different with before.

Message 10 of 11
Kent1Cooper
in reply to: 2e4lite


@2e4lite wrote:

....I feel the program is too slow, can make it quickly?  .... 

  



It might very well speed it up, and would certainly shorten the code, if you use (cond) instead of what appear to be a long series of (if) functions all nested inside each other.  For one thing, it eliminates all the (progn) functions needed to combine multiple operations into one 'then' argument for an (if) function.  I have also pulled the (strcase)-ing of the layer_name argument out of each one and put it once at the beginning, and taken the liberty of pulling the resetting of CMDECHO out of each one [because it isn't actually in every one of them] and putting it at the end.

 

....

(setq layer_name (strcase layer_name))

(cond

  ( (= layer_name "SIDE")
    (layer_off "*" )
    (layer_on "SIDE") 
  ); SIDE condition
  ( (= layer_name "PURCHASE")
    (layer_off "*")
    (layer_on "PURCHASE")

    (layer_on "PURCHASE_OM")
    (setvar "clayer" "PURCHASE")
  ); PURCHASE condition
  ( (= layer_name "MATER")
    (layer_off "*")
    (layer_on "MATER")
  ); MATER condition


;; ... etc. ...

 

); end cond

(setvar "CMDECHO" echo )

 

You don't include the (layer_off) or (find) function definitions, if they might affect how long it takes.

 

EDIT:  Also, looking more closely at the (layer_on) function, it seems that for every Layer you process with it, it must step through the entire Layer table, looking for a Layer with the right name, and must keep looking even after it has found that Layer and worked on it.  That may be part of the slowness problem.  If I understand what it's doing correctly, I think you could do it this way, which would eliminate the need to step all the way through all Layers every time.  It also eliminates some variables [I also removed echo from the localized variables list, which is not used in that subroutine, and so doesn't belong, and combined a lot of separate (setq) functions into one]:

 

(defun layer_on ( layer_name / data c70 c62 q70 q62 have )
  (setq have 0)
  (if (tblsearch "layer" layer_name); will work whether or not case agrees
    (progn
      (setq
        data (entget (tblobjname "layer" layer_name))
        c70 (logand (cdr (assoc 70 data)) 122)
        c62 (abs (cdr (assoc 62 data)))
        q70 (cons 70 c70)
        q62 (cons 62 c62)
        data (subst q70 (assoc 70 data) data )
        data (subst q62 (assoc 62 data) data )

        have 1
      ); setq
      (entmod data)
    ); progn
  ); if
  (setvar "Sortents" 112)
  (if (= have 0) (createlayer layer_name))
  ( if (and (= ( find layer_name "*" ) 0) (= ( find layer_name "?" ) 0) ) (setvar "Clayer" layer_name ))
  (princ)
); defun

 

Or, further shortened with fewer variables:

(defun layer_on (layer_name / data have)
  (setq have 0)
  (if (tblsearch "layer" layer_name)
    (progn
      (setq

        have 1
        data (entget (tblobjname "layer" lname))
        data (subst (cons 70 (logand (cdr (assoc 70 data)) 122)) (assoc 70 data) data)
        data (subst (cons 62 (abs (cdr (assoc 62 data)))) (assoc 62 data) data)
      ); setq
      (entmod data)
    ); progn
  ); if
  (setvar "Sortents" 112)
  (if (= have 0) (createlayer layer_name))
  ( if (and (= ( find layer_name "*" ) 0) (= ( find layer_name "?" ) 0) ) (setvar "Clayer" layer_name ))
  (princ)
)

Kent Cooper, AIA
Message 11 of 11
2e4lite
in reply to: Kent1Cooper

Hey ,Kent1 Cooper.Thank you for your quick reply! I add a variable : (SETQ tbdata (tblsearch "layer" layer_name)) in the function of  layer_on and as  localized variable to your last version.

 

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

Post to forums  

Autodesk Design & Make Report

”Boost