Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
*Expert Elite*
dbroad
Posts: 1,551
Registered: ‎08-16-2007
Message 11 of 23 (214 Views)

Re: setting DIMLFAC

03-31-2012 05:52 AM in reply to: knlooi

Knooli,

 

I would encourage you to avoid techniques to manipulate dimlfac based on scale factors.  Such techniques are simply not needed. (AutoCAD user for more than 25 years).

 

Best practice is to work on object full size and dimension them in the same space they are drawn in IMO.  If I need to have multiple scales on a single sheet, I typically work with each scale in its own drawing file and xattach the separate files into a sheet file.  Others would use several annotation scales within a single model space and use paper space for scaling the plots.

 

Another technique is to wrap the objects inside block and use bedit.  Problem with that is that bedit always resets the drawing scale to 1:1 which is annoying.

 

Others use viewports for scaling and dimension in paper space of the sheet they are plotting.

 

I prefer not to work behind others who have scaled object in model space so that dimensions and the distance command can no longer measure them.  To add information or to edit such a drawing requires checking the properties of the dimensions, finding dimlfac, scaling the objects back to full size, and then re-scaling them.

 

Good luck.

Contributor
knlooi
Posts: 15
Registered: ‎04-14-2011
Message 12 of 23 (193 Views)

Re: setting DIMLFAC

04-01-2012 10:10 PM in reply to: dbroad

Thanks for your reply

 

Kent& dbroad,

I don't understand how to use paper space. Normally, our full drawing have more then hundred objects, difference size of each object. If I set the viewing scale, all the pages size cannot make it standardize to keeping softcopy and hardcopy. Actually, I need to make like Inventor “Detail” command, can be scale up and scale down object, but dimension same as original object.

 

Pbejse,

Yes, I missed the data lisp.

The data lisp is use to call tooling_info.lsp, this lisp is using in other software and not is autolisp.

Attached dwg file included data information, when running tcmr.lsp will skip the data lisp.

*Expert Elite*
pbejse
Posts: 2,462
Registered: ‎11-24-2009
Message 13 of 23 (187 Views)

Re: setting DIMLFAC

04-01-2012 11:58 PM in reply to: knlooi

knlooi wrote:

Thanks for your reply

  

Pbejse,

Yes, I missed the data lisp.

The data lisp is use to call tooling_info.lsp, this lisp is using in other software and not is autolisp.

Attached dwg file included data information, when running tcmr.lsp will skip the data lisp.


**** Try the lisp routine now*****

I commented that part where i the modifed the code [see attached]
;;; <-------

I totally agree with kent and dbroad regarding scaling the drawing and using paperpsapce though
But since you already had it setup the way you had might as well help you out a little.

Cheers

 

BTW:

Take out coment tag  where you  load the data.lsp, I left it there while testing your code

 

HTH

 

*Expert Elite*
pbejse
Posts: 2,462
Registered: ‎11-24-2009
Message 14 of 23 (181 Views)

Re: setting DIMLFAC

04-02-2012 12:22 AM in reply to: pbejse

As i was watching the video you posted, you mentioned there that you want the DIMLFAC value to maintain the

value of 1

 

So

.....

(progn (setvar 'Dimlfac (* 1.22222 scale1))
                       (command "_-dimstyle" "_apply" obj "")
                      (setvar 'Dimlfac 1);<----- here
                       )

......

 or here

(setvar "osmode" oosm)

(setvar 'Dimlfac 1);<----- or here

  ) (alert "User Cancel!")

.....

 

 

HTH

 

Contributor
knlooi
Posts: 15
Registered: ‎04-14-2011
Message 15 of 23 (176 Views)

Re: setting DIMLFAC

04-02-2012 01:00 AM in reply to: pbejse

Pbejse,

Thank you very much, the lisp work is very good now.

One more question need your help is the dimension missing dia. and tolerance, can use the lisp to set it back?

*Expert Elite*
pbejse
Posts: 2,462
Registered: ‎11-24-2009
Message 16 of 23 (172 Views)

Re: setting DIMLFAC

04-02-2012 01:17 AM in reply to: knlooi

knlooi wrote:

Pbejse,

Thank you very much, the lisp work is very good now.

One more question need your help is the dimension missing dia. and tolerance, can use the lisp to set it back?


Oh that... Sure it can be done

Questions:

What other dimension properties beside Tolerance do you usually override?

Theres a long list for such, so  i need to reduce the number to a few selected properties

 

Answer those Q's then  I'll iupdate the code and get back to you

 

 

 

 


 

*Expert Elite*
pbejse
Posts: 2,462
Registered: ‎11-24-2009
Message 17 of 23 (165 Views)

Re: setting DIMLFAC

04-02-2012 01:53 AM in reply to: pbejse

Easiest solution is to repalce all this

(progn (setvar 'Dimlfac (* 1.22222 scale1))
                       (command "_-dimstyle" "_apply" obj "")
                       (setvar 'Dimlfac 1)
                       )

 

to this

(command "_dimoverride" "DIMLFAC" (* 1.22222 scale1) "" obj "")

 

Try it.

Contributor
knlooi
Posts: 15
Registered: ‎04-14-2011
Message 18 of 23 (163 Views)

Re: setting DIMLFAC

04-02-2012 02:20 AM in reply to: pbejse

Pbejse,

Thanks your help!

 

Is symmetrical and deviation.

*Expert Elite*
pbejse
Posts: 2,462
Registered: ‎11-24-2009
Message 19 of 23 (157 Views)

Re: setting DIMLFAC

04-02-2012 03:13 AM in reply to: knlooi

knlooi wrote:

Pbejse,

Thanks your help!

 


Glad I could help.

 

There's still a lot of improvement that can be done on your lisp code. Did you wirte this one yourself?  

Code after code you will understand  and learn what works and what doesnt.

 

Keep on coding knlooi

 

Cheers :smileyhappy:

 

Contributor
knlooi
Posts: 15
Registered: ‎04-14-2011
Message 20 of 23 (154 Views)

Re: setting DIMLFAC

04-02-2012 03:43 AM in reply to: pbejse

Ok, I try to write this lisp. Thanks again.

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.