I took a question posted to the GTWiki today. Here is the question and response:
I am looking for one macro which will create datum plates to live planes ( Equation with referance axis system ) Can anybody help on this .
Thanks Gajendra
Hello Gajendra,
Excellent suggestion. There are a few ways you can attack this:
1.) Make a macro converts the datum geometry to live.
The unfortunate thing about this task is that datum conversion and replacement is not exposed to Digital Project/CATIA Visual Basic. You would only need to use this method if you have already used the plane system from which to model; i.e. if the planes or some of the planes are parents to other geometry in the file. I wrote an article on a hack that can do this conversion on points using the command SendKeys. This is buggy though, should not be used in practice, and may not work because it was written in R3. Nevertheless, it’s a good example of the type of VB hack scripting you’ll have to do in order to do a genuine conversion from datum to live.
2.) Make a macro that reads the location of the datum geometry and creates a new plane.
This technique is much simpler because it does not rely on buggy hacks to create. This technique would only work if you haven’t already modeled on top of your plane system; the planes cannot be parents. If you just ran a “new plane creator” on a model that has been parametrically linked, your original datum planes would still control the model. There is no automated way to “replace” datum planes with the newly created live planes. There is an interesting article on the GTWiki about making new points from the locations of datum points here. This would be a good place to begin if you wanted to learn how to make new geometry, just replace words like “HybridShapePointCoord” and “.addnewpointcoord(” with “HybridShapePlaneOffset” and “.addnewplaneoffset(” respectively. And your measuring would need to be different, but I’ll let you figure that out. 🙂
3.) Make a powercopy or UDF of a plane with parameter inputs.
It may seem like forever, but making a UDF and instantiating it several times can be quicker than investing the time to build a script. The general rule at GT is five-hundred; if the process has more than 500 objects or steps, it has the potential to be automated. If less, it is manually completed. Once you get into a groove, you can do hundreds of procedures quite quickly (using the double-click on a command or “repeat” on a powercopy instantiation.)
4.) Do a manual conversion of a datum plane into a live plane.
Sometimes the simplest answer is the best. If you only have a moderate number of planes, and you plan on converting them only once, you may want to consider doing a manual conversion. All datum geometry can be instantly made live, by double-clicking on the geometry. You will see the “Explicit” pull down on the Plane Dialog Box. Just change that to “Offset from Plane” or other live option. It will redeclare the object type into a usable plane, and will maintain any links that may be a child to this plane.
I hope this helps. Reply back if you have any questions about automation in VB (if you are just getting started in this department). I can go more in depth on either of those techniques mentioned above.
Best, God
Hello Nicolas,
Let me introduce Myself Gajendra Bhirud Working as a CATIA v5 designer . I read your Post on http://www.gtwiki.org regarding creating datum live planes from datum http://www.gtwiki.org/mwiki/index.php?title=User_talk:gajendra1980
Thanks for the suggestion; unfortunately I am just as Catia V5 user and not comfortable on VB script.
About Creating the Planes from datum’s:-
Actually we are working on some project where we need to convert the model completely parametric, Ex: – All sketches constraint, Planes live points live.
One of the macro is really helpful for me for this task is creating live points but this creates new points, needs to relink again as parents.
For the planes currently we are manually selecting the planes and Making it live by using equation. If number of planes is more it takes too much time.
I appreciate if you can help on this. I would be happy to share some more ideas where we can work together to create some scripts which will help the users to work effectively.
Thanks and Regards
Gajendra Bhirud
Gajendra,
I understand your problem when you mention the conversion of datum geometry. Unfortunately, if you want to create a VB script that converts the datum points or planes into live points or planes, there is no VB function for “Replace.” This means that if you make a new plane, there is no way to transfer the child links from the datum plane to the new plane. So, the only solution to converting datum geometry with VB scripting, is to run the point conversion tool (for just points) prior to making any changes to the model. This way there is not any links to transfer.
These tasks are more complex and difficult for the average VB scripter, and would be reserved for advance knowledge of the program. There are workarounds with VB scripting to make datum objects live, like when using the SendKeys command, but this is buggy and doesn’t work between releases. Since you mentioned that you are not familiar with VB scripting, you may need to factor in a conversion timeframe whenever you receive a datum model from an outside or inside source. Most of the basic non-surface geometry, like points/planes/curves, can be quickly instantiated with smart powercopies.
For example, most points can be converted with the technique posted on the wiki: http://www.gtwiki.org/mwiki/index.php?title=Talk:Convert_Datum_Points_to_Live or http://www.gtwiki.org/mwiki/index.php?title=Convert_Datum_Points_to_Live .
Most planes could be converted in a similar way, as long as the redeclaration of the plane-type doesn’t move the plane to the XY, which it probably will do.
And for curves, I would make a powercopy of a spline. The spline will be based on several points so that it matches the original curvature of the original line as much as possible. Then just manually instantiate this curve or use the Powercopy Instantiator I created: http://www.gtwiki.org/mwiki/index.php?title=PowerCopy_Instantiator_by_Geometrical_Sets
Best, -Nick
Gtwiki was not working anymore,does there have a kind of handbook/manual for learning DP?
That’s a bummer. GTWiki was a great resource. You can still read most of the articles here: