Author Topic: Problem with move to dim style in a block  (Read 4127 times)

0 Members and 1 Guest are viewing this topic.

Coder

  • Swamp Rat
  • Posts: 827
Problem with move to dim style in a block
« on: July 27, 2014, 12:58:13 AM »
Hello guys .

I wrote a routine to change a dimstyle for a rotated dimension object to another dimstyle in a block , everything is okay BUT I can't see the changes until I double click on every block to enter the block
then have to save before closing the block .

I added the vla-regen function but it does not work .

Thanks in advance .  :-)

David Bethel

  • Swamp Rat
  • Posts: 656
Re: Problem with move to dim style in a block
« Reply #1 on: July 27, 2014, 08:07:53 AM »
Did you try ( entupd ) after the ( entmod )  ?
R12 Dos - A2K

Coder

  • Swamp Rat
  • Posts: 827
Re: Problem with move to dim style in a block
« Reply #2 on: July 27, 2014, 08:28:40 AM »
Did you try ( entupd ) after the ( entmod )  ?

Hi David ,

I used the vlisp function vla-put-stylename and not dxf codes .

Any idea ?

Many thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Coder

  • Swamp Rat
  • Posts: 827
Re: Problem with move to dim style in a block
« Reply #4 on: July 27, 2014, 11:31:03 AM »
Thank you CAB .

this is the codes .

Code: [Select]
(defun c:toStyle (/ mydoc)
  (vlax-for blks (vla-get-blocks (setq mydoc (vla-get-activedocument (vlax-get-acad-object))))
    (if (eq :vlax-false (vla-get-islayout blks))
      (vlax-for objs blks
        (if (wcmatch (vla-get-objectname objs) "AcDb*Dimension")
          (vla-put-stylename objs "Standard")
        )
      )
    )
  )
  (vla-regen mydoc acallviewports)
  (princ)
)

Coder

  • Swamp Rat
  • Posts: 827
Re: Problem with move to dim style in a block
« Reply #5 on: July 27, 2014, 02:39:49 PM »
Anyone knows why the changes of the Dimension style not appeared until I open the block manually and save the block ?

 :-(

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Problem with move to dim style in a block
« Reply #6 on: July 27, 2014, 04:10:41 PM »
Shot in the dark but does the command DimRegen have any effect on the insert?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Problem with move to dim style in a block
« Reply #7 on: July 27, 2014, 04:24:30 PM »
Following David's advice: have you tried using vla-update on each dim object?

Coder

  • Swamp Rat
  • Posts: 827
Re: Problem with move to dim style in a block
« Reply #8 on: July 27, 2014, 06:10:27 PM »
Following David's advice: have you tried using vla-update on each dim object?
Shot in the dark but does the command DimRegen have any effect on the insert?

No luck at all .  :-o

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Problem with move to dim style in a block
« Reply #9 on: July 27, 2014, 06:28:32 PM »
Can you post a test DWG of your block(s)?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Problem with move to dim style in a block
« Reply #10 on: July 27, 2014, 06:30:41 PM »
Can you post a test DWG of your block(s)?

... and an explicit description of your intent.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Coder

  • Swamp Rat
  • Posts: 827
Re: Problem with move to dim style in a block
« Reply #11 on: July 27, 2014, 06:35:35 PM »
This is a sample block that I am working on .

many thanks for your help CAB

Coder

  • Swamp Rat
  • Posts: 827
Re: Problem with move to dim style in a block
« Reply #12 on: July 28, 2014, 04:50:26 AM »
Can you post a test DWG of your block(s)?

... and an explicit description of your intent.

Thanks Kerry for your interests in helping me  :-)

My codes in post no #4 can change the Dimension style name to Standard , but I can not see the changes of the new style until I double click on the block to enter the block and close it after that to see the new changes .
The vla-regen does not work as it works with the other modifications on blocks .

Many thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Problem with move to dim style in a block
« Reply #13 on: July 28, 2014, 08:35:32 AM »
I worked on it last night with no luck.
No time today.  :?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Coder

  • Swamp Rat
  • Posts: 827
Re: Problem with move to dim style in a block
« Reply #14 on: July 28, 2014, 08:43:55 AM »
I worked on it last night with no luck.
No time today.  :?

Did you have the same outcome that I have already described and couldn't see the changes unless to reopen and save the block ?