CoCreate User Forum  

Go Back   CoCreate User Forum > Support > Customization

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 03-27-2006, 01:00 AM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Arrow Revisited: Change scale of a Sketch

Hi,

Last year I posted a question about rescaling a Sketch in Annotation.
The answer was that it should be possible by using the Drafting command PART_DRW_SCALE.
I made this Lisp macro:

Code:
(in-package :jaaps_tools)
(use-package :oli)
(sd-defdialog 'rescale_sketch
:dialog-title "Rescale Sketch"

 
:variables '( 
(schets :selection (*sd-anno-sketch-seltype*) :Title "Sketch")
(schaal :initial-value nil :value-type :number :title "Schaal")
) 

:local-functions 
'(
(doit ()
(sd-execute-annotator-command :cmd "PART_DRW_SCALE schets schaal")
)
)


:ok-action
'(doit)
)
The problem is... nothing happens. I choose the Sketch, fill in the scale, press OK. The "hour glass" blinks for half a second... that's it. Annotation doesn't hang, it just doesn't do the scaling trick...
Anyone have a clue what's wrong?
Thanks!
Regards,
Jaap
Reply With Quote
  #2  
Old 03-27-2006, 10:04 PM
Markus Markus is offline
Registered User
 
Join Date: Oct 2002
Location: Sindelfingen, Germany
Posts: 88
Re: Revisited: Change scale of a Sketch

Hello Jaap,

you made two mistakes:
  1. You have to pass the values of your variables to the annotator command
  2. The result of the selection is a Designer sel_item which can't be passed to the Annotator command as is. You need to extract the unique part ID from this and pass this to Annotator.

The corrected code (doit body) looks like this:
Code:
(sd-execute-annotator-command
   :cmd (format nil "PART_DRW_SCALE '~A' ~A" (sd-am-inq-unique-name schets) schaal))
Cheers,
Markus
Reply With Quote
  #3  
Old 03-27-2006, 10:32 PM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Re: Revisited: Change scale of a Sketch

Thanks! It works!!
This was a learnful experience for me. We never used ME10, so ME10 macros are a bit mysterious to me....

Regards,
Jaap
Reply With Quote
  #4  
Old 04-10-2006, 11:50 PM
jkramer's Avatar
jkramer jkramer is offline
Registered User
 
Join Date: Oct 2002
Location: the Netherlands
Posts: 382
Post Re: Revisited: Change scale of a Sketch

Hi,

I thought it'd be nice to post the working macro, so that others can use it, too.
Here's the code:
Code:
(in-package :jaaps_tools)
(use-package :oli)
(sd-defdialog 'rescale_sketch
:dialog-title "Rescale Sketch"

 
:variables 
'( 
(schets :selection (*sd-anno-sketch-seltype*) :Title "Sketch")
(schaal :initial-value nil :value-type :number :title "Schaal")
) 

:local-functions 
'(
(doit ()
(sd-execute-annotator-command 
:cmd (format nil "PART_DRW_SCALE '~A' ~A" (sd-am-inq-unique-name schets) schaal))
)
)


  :ok-action
	'(doit)
)
Regards,
Jaap
Reply With Quote
  #5  
Old 03-23-2014, 10:28 PM
siful11 siful11 is offline
Registered User
 
Join Date: Aug 2011
Posts: 1
Re: Revisited: Change scale of a Sketch

Hi,

I try the code provided by Jaap in V17, it works well on the scaling. But after the scaling, I am not able to put in additional dimension to the item/element in the sketch. The following error msg pop up
"The selected element cannot be used to create a dimension of the current type [Single-Dimension]. Please select again."

In order to put in dimension again, I need to change owner for all elements in the sketch to sheet.

Anyone can help to improve this code?

Regards,
CF
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 06:35 AM.



Hosted by SureServer    Forums   Modeling FAQ   Macro Site   Vendor/Contractors   Software Resellers   CoCreate   Gallery   Home   Board Members   Regional User Groups  By-Laws  

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
You Rated this Thread: