| |  | Gut zu wissen: Hilfreiche Tipps und Tricks aus der Praxis prägnant, und auf den Punkt gebracht für PTC CREO | | |  | SF WALLCHECK , eine App
|
Autor
|
Thema: Problems of custom feature holes (915 / mal gelesen)
|
renchaoroy Mitglied Engineer

 Beiträge: 15 Registriert: 05.06.2021 DELL-Precision 3530/Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz 2.59 GHZ/16.0 GB/Windows 10 Home/20H2/OS revision19042.985/DirectModeling (x64edition)/Revision: 19.0/Datecode: F000(19.0.0.790,09-May-2014)
|
erstellt am: 14. Jul. 2021 08:47 <-- editieren / zitieren --> Unities abgeben:         
Hi My Friends, I want to define a command for making holes quickly, here is my code, SFace is the selected face, RePnt is the selected 3D point, They are correct.but I am running, the system prompt "parameter not fully defined", is a custom feature does not support Lisp?
Code: (defun psd-make-hole(SFace YFace SNum) (let (AllFace RePnt (OwnerPart (sd-inq-parent-obj SFace)) (SFCenter (sd-vec-scale (sd-vec-add(sd-face-ll-pnt (sd-inq-face-geo SFace :Dest-space :global))(sd-face-ur-pnt (sd-inq-face-geo SFace :Dest-space :global))) 0.5))) (setf AllFace (sd-call-cmds (get_selection :focus_type *sd-plane-seltype* :select :in_part OwnerPart :all_3d))) (setf RePnt (sd-vec-translate SFCenter (sd-plane-normal(sd-inq-geo-props YFace :Dest-space :global)) (- (sd-call-cmds (measure_dist oint_surface SFCenter YFace)) (+ 4 (/ SNum 2))))) ;;The error occurred in the following code (create_custom_feature mach_adv_library_countersunk_throughhole :action :create :sel_face SFace :cen_pnt RePnt :axis (sd-plane-normal(sd-inq-geo-props SFaces :Dest-space :global)) :Drill_dia SNum :chamfer_depth 0 :chamfer_angle 90 :back_chamfer_depth 0 :back_chamfer_angle 90 :name "hole") ) )
Thanks ------------------ A mechanical engineer who loves to program  Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |

| |
der_Wolfgang Moderator Tastenhauer
     
 Beiträge: 2296 Registriert: 3.20. ● PE20+60+80@home ● W10 Pro Build19045.5737 ● Drafting V17~V20.7 ● Modeling V17~V20.7 ● Windchill 12.1.2.6 ● UWGM Client 13.0.0.1 ● Taschenrechner
|
erstellt am: 15. Jul. 2021 11:38 <-- editieren / zitieren --> Unities abgeben:          Nur für renchaoroy
your command recording isn't accurate enough, I think. create_custom_feature is just a UI-wrapper which opens the custom feature browser. No need to do so when calling programmatially. change Code: (create_custom_feature mach_adv_library_countersunk_throughhole :action :create
to Code: (mach_adv_library_countersunk_throughhole :action :create
and better use a sd-call-cmds around it ... Code: (sd-call-cmds (mach_adv_library_countersunk_throughhole :action :create .... )
I did not execute that code. ------------------ ● Firefox ESR ● Java Forum Stuttgart JUGS ● OSD Hilfeseite (de) / help page (en) ● NotePad++ ● BuFDi ● Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP |
| Anzeige.:
Anzeige: (Infos zum Werbeplatz >>)
 |